Add new entry blog: Web Infra 1 (#3)
* Change blog entry style : titles font weight lighter->normal * Add tmpfs scripts for linux (dev only) Co-authored-by: Corentin <corentin-pro@mail.com> Co-authored-by: Jimmy Vargo <james@ayo.tokyo> Reviewed-on: ayo/website#3
This commit is contained in:
parent
bb2fd54e41
commit
6fdcf4f102
10 changed files with 41 additions and 37 deletions
BIN
assets/blog/2021-10-07_Deep Learning Framework Benchmarks/Deep Learning Framework Benchmarks.md
(Stored with Git LFS)
BIN
assets/blog/2021-10-07_Deep Learning Framework Benchmarks/Deep Learning Framework Benchmarks.md
(Stored with Git LFS)
Binary file not shown.
BIN
assets/blog/2023-09-12_Self-Hosted Web Infrastructure/Self-Hosted Web Infrastructure.md
(Stored with Git LFS)
Normal file
BIN
assets/blog/2023-09-12_Self-Hosted Web Infrastructure/Self-Hosted Web Infrastructure.md
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/blog/2023-09-12_Self-Hosted Web Infrastructure/odroidn2plus.jpg
(Stored with Git LFS)
Normal file
BIN
assets/blog/2023-09-12_Self-Hosted Web Infrastructure/odroidn2plus.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/blog/draft_2023-09-XX-_Web_infrastructure_2/Web Infrastructure 2.md
(Stored with Git LFS)
Normal file
BIN
assets/blog/draft_2023-09-XX-_Web_infrastructure_2/Web Infrastructure 2.md
(Stored with Git LFS)
Normal file
Binary file not shown.
|
|
@ -32,6 +32,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.prod.js",
|
||||
"predev": "./scripts/tmpfs_dirs.sh",
|
||||
"dev": "webpack --config webpack.dev.js",
|
||||
"server": "webpack --config webpack.server.js",
|
||||
"start": "node server.js",
|
||||
|
|
|
|||
17
scripts/tmpfs_dirs.sh
Executable file
17
scripts/tmpfs_dirs.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#! /bin/bash
|
||||
|
||||
if [[ $(uname) != "Linux" ]]; then
|
||||
echo "Not on Linux : no tmpfs"
|
||||
exit
|
||||
fi
|
||||
|
||||
CWD=$(cd -P . && pwd)
|
||||
readarray -t TMPFS_DIRS < <(df -lt tmpfs --output=target | tail -n +2)
|
||||
|
||||
|
||||
if [[ " ${TMPFS_DIRS[*]} " =~ " ${CWD}/public " ]]; then
|
||||
echo "public alread a tmpfs"
|
||||
else
|
||||
echo "Mounting public as tmpfs"
|
||||
sudo mount -m -t tmpfs tmpfs public
|
||||
fi
|
||||
|
|
@ -38,18 +38,16 @@ class BlogEntryComponent extends Component
|
|||
<img id="image-view"/>
|
||||
</div>,
|
||||
<script>
|
||||
{`const container = document.getElementById("image-container")
|
||||
const image_view = document.getElementById("image-view")
|
||||
|
||||
{`
|
||||
function open_image(src)
|
||||
{
|
||||
image_view.src = src
|
||||
container.style.display = 'flex'
|
||||
document.getElementById("image-view").src = src
|
||||
document.getElementById("image-container").style.display = 'flex'
|
||||
}
|
||||
|
||||
function close_image()
|
||||
{
|
||||
container.style.display = 'none'
|
||||
document.getElementById("image-container").style.display = 'none'
|
||||
}`}
|
||||
</script>
|
||||
]
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
h1, h2, h3
|
||||
{
|
||||
font-weight: lighter;
|
||||
font-weight: normal;
|
||||
margin: 8px 0;
|
||||
color: var(--highlight-fg-color);
|
||||
}
|
||||
|
|
|
|||
13
src/test.js
13
src/test.js
|
|
@ -1,13 +0,0 @@
|
|||
const container = document.getElementById("image-container")
|
||||
const image_view = document.getElementById("image-view")
|
||||
|
||||
function view_image(src)
|
||||
{
|
||||
image_view.src = src
|
||||
container.style.display = 'flex'
|
||||
}
|
||||
|
||||
function close_image()
|
||||
{
|
||||
container.style.display = 'none'
|
||||
}
|
||||
|
|
@ -66,8 +66,8 @@ class BlogListingPlugin
|
|||
},
|
||||
(compilationAssets, callback) => {
|
||||
let content = []
|
||||
Object.keys(compilationAssets).forEach((file_path) => {
|
||||
if(file_path.startsWith('blog') && file_path.endsWith('.md'))
|
||||
Object.keys(compilationAssets).sort().reverse().forEach((file_path) => {
|
||||
if(file_path.startsWith('blog') && file_path.endsWith('.md') && !file_path.endsWith('_draft.md'))
|
||||
{
|
||||
const file_name = path.basename(file_path).slice(0, -3)
|
||||
const blog_info = path.basename(path.dirname(file_path)).split('_')
|
||||
|
|
@ -131,11 +131,7 @@ module.exports = {
|
|||
type: "asset/inline"
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|jpeg|gif)$/,
|
||||
type: "asset/resource"
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|otf)$/,
|
||||
test: /assets\/.*\.(png|jpg|jpeg|gif|ttf|otf)$/,
|
||||
type: "asset/resource"
|
||||
}
|
||||
]
|
||||
|
|
@ -147,18 +143,14 @@ module.exports = {
|
|||
{from: 'index.html'},
|
||||
{from: 'robot.txt'},
|
||||
{from: 'src/lang', to: 'lang'},
|
||||
{from: 'assets/blog', to: 'blog'},
|
||||
{from: 'assets/icons', to: 'assets/icons'},
|
||||
{from: 'assets/images', to: 'assets/images'},
|
||||
{from: 'assets/theme', to: 'assets/theme'},
|
||||
{from: 'assets/fonts', to: 'assets/fonts'}
|
||||
{from: 'assets', to: 'assets', globOptions: {ignore: '**/blog/**'}},
|
||||
{from: 'assets/blog', to: 'blog', globOptions: {ignore: '**/blog/draft_*/**'}}
|
||||
]})
|
||||
],
|
||||
output:
|
||||
{
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'public'),
|
||||
assetModuleFilename: 'assets/[query].[ext]',
|
||||
clean: true
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue