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": {
|
"scripts": {
|
||||||
"build": "webpack --config webpack.prod.js",
|
"build": "webpack --config webpack.prod.js",
|
||||||
|
"predev": "./scripts/tmpfs_dirs.sh",
|
||||||
"dev": "webpack --config webpack.dev.js",
|
"dev": "webpack --config webpack.dev.js",
|
||||||
"server": "webpack --config webpack.server.js",
|
"server": "webpack --config webpack.server.js",
|
||||||
"start": "node 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"/>
|
<img id="image-view"/>
|
||||||
</div>,
|
</div>,
|
||||||
<script>
|
<script>
|
||||||
{`const container = document.getElementById("image-container")
|
{`
|
||||||
const image_view = document.getElementById("image-view")
|
|
||||||
|
|
||||||
function open_image(src)
|
function open_image(src)
|
||||||
{
|
{
|
||||||
image_view.src = src
|
document.getElementById("image-view").src = src
|
||||||
container.style.display = 'flex'
|
document.getElementById("image-container").style.display = 'flex'
|
||||||
}
|
}
|
||||||
|
|
||||||
function close_image()
|
function close_image()
|
||||||
{
|
{
|
||||||
container.style.display = 'none'
|
document.getElementById("image-container").style.display = 'none'
|
||||||
}`}
|
}`}
|
||||||
</script>
|
</script>
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
h1, h2, h3
|
h1, h2, h3
|
||||||
{
|
{
|
||||||
font-weight: lighter;
|
font-weight: normal;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
color: var(--highlight-fg-color);
|
color: var(--highlight-fg-color);
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
p
|
p
|
||||||
{
|
{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
img
|
img
|
||||||
{
|
{
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
||||||
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) => {
|
(compilationAssets, callback) => {
|
||||||
let content = []
|
let content = []
|
||||||
Object.keys(compilationAssets).forEach((file_path) => {
|
Object.keys(compilationAssets).sort().reverse().forEach((file_path) => {
|
||||||
if(file_path.startsWith('blog') && file_path.endsWith('.md'))
|
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 file_name = path.basename(file_path).slice(0, -3)
|
||||||
const blog_info = path.basename(path.dirname(file_path)).split('_')
|
const blog_info = path.basename(path.dirname(file_path)).split('_')
|
||||||
|
|
@ -131,11 +131,7 @@ module.exports = {
|
||||||
type: "asset/inline"
|
type: "asset/inline"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|jpg|jpeg|gif)$/,
|
test: /assets\/.*\.(png|jpg|jpeg|gif|ttf|otf)$/,
|
||||||
type: "asset/resource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.(ttf|otf)$/,
|
|
||||||
type: "asset/resource"
|
type: "asset/resource"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -147,18 +143,14 @@ module.exports = {
|
||||||
{from: 'index.html'},
|
{from: 'index.html'},
|
||||||
{from: 'robot.txt'},
|
{from: 'robot.txt'},
|
||||||
{from: 'src/lang', to: 'lang'},
|
{from: 'src/lang', to: 'lang'},
|
||||||
{from: 'assets/blog', to: 'blog'},
|
{from: 'assets', to: 'assets', globOptions: {ignore: '**/blog/**'}},
|
||||||
{from: 'assets/icons', to: 'assets/icons'},
|
{from: 'assets/blog', to: 'blog', globOptions: {ignore: '**/blog/draft_*/**'}}
|
||||||
{from: 'assets/images', to: 'assets/images'},
|
|
||||||
{from: 'assets/theme', to: 'assets/theme'},
|
|
||||||
{from: 'assets/fonts', to: 'assets/fonts'}
|
|
||||||
]})
|
]})
|
||||||
],
|
],
|
||||||
output:
|
output:
|
||||||
{
|
{
|
||||||
filename: 'bundle.js',
|
filename: 'bundle.js',
|
||||||
path: path.resolve(__dirname, 'public'),
|
path: path.resolve(__dirname, 'public'),
|
||||||
assetModuleFilename: 'assets/[query].[ext]',
|
|
||||||
clean: true
|
clean: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue