This repository has been archived on 2021-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
custom-nix/blog/builder.sh

22 lines
450 B
Bash
Raw Normal View History

2020-04-06 16:51:17 -07:00
source $stdenv/setup
2020-09-02 17:03:02 -07:00
# Copy files to a mutable directory.
2020-04-06 16:51:17 -07:00
cp -r $src/* .
2020-09-02 17:03:02 -07:00
# 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
2020-09-02 17:03:02 -07:00
cp -r public/$publicPath/* $out/
# Render math in HTML and XML files.
node $server &
SERVER_ID=$!
2020-09-02 17:03:02 -07:00
find $out/ -regex "$out/.*\.html" | xargs ruby $converter
kill $SERVER_ID