Nix flake / derivation for building my blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
450 B

source $stdenv/setup
# Copy files to a mutable directory.
cp -r $src/* .
# Hugo can't set baseUrl via CLI for multi-lingual hosts.
# We have to manually edit the configuration.
sed -i "$urlSub" config.toml
# Build site with Hugo
hugo $extraFlags
# Output result
mkdir $out
cp -r public/$publicPath/* $out/
# Render math in HTML and XML files.
node $server &
find $out/ -regex "$out/.*\.html" | xargs ruby $converter