Bundle files from web-files at build time.
This commit is contained in:
@@ -8,8 +8,16 @@ cp -r $src/* .
|
||||
# We'll generate some static files so make static writable
|
||||
mkdir -p static && chmod -R u+w static
|
||||
|
||||
# We host some static files (KaTeX CSS in production) on
|
||||
# static.danilafe.com. However, we can just bundle them here instead!
|
||||
echo '[params]' >> config-urls.toml
|
||||
echo 'katexCssUrl = "/katex/katex.min.css"' >> config-urls.toml
|
||||
echo 'bergamotJsUrl = "/bergamot/bergamot.js"' >> config-urls.toml
|
||||
echo 'katexExpressionJsUrl = "/katex-expression/katex-expression.esm.js"' >> config-urls.toml
|
||||
cp -r $webFiles/* static/
|
||||
|
||||
# Build site with Hugo
|
||||
hugo $hugoFlags --config=config.toml,config-gen.toml
|
||||
hugo $hugoFlags --config=config.toml,config-urls.toml,config-gen.toml
|
||||
|
||||
# Create generated files
|
||||
# Can't do submodules because nix flake inputs get their .git deleted
|
||||
@@ -18,7 +26,7 @@ stork build --input public/index.toml --output static/index.st # Search index
|
||||
cp $resume/Resume-Danila-Fedorin.pdf static/Resume-Danila-Fedorin.pdf
|
||||
|
||||
# Static folder changed, re-run Hugo
|
||||
hugo $hugoFlags --config=config.toml,config-gen.toml
|
||||
hugo $hugoFlags --config=config.toml,config-urls.toml,config-gen.toml
|
||||
|
||||
# Output result
|
||||
mkdir $out
|
||||
|
||||
Reference in New Issue
Block a user