2020-04-06 16:51:17 -07:00
|
|
|
source $stdenv/setup
|
2020-04-07 17:52:27 -07:00
|
|
|
|
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-04-07 17:52:27 -07:00
|
|
|
|
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
|
|
|
|
|
2021-01-10 19:57:22 -08:00
|
|
|
# Run the submodule command in the source .git
|
|
|
|
# repo, amending the config.
|
|
|
|
cwdir=$(pwd)
|
|
|
|
cd $src
|
|
|
|
ruby $submodules >> $cwdir/config.toml
|
|
|
|
cd $cwdir
|
|
|
|
|
2020-09-02 17:03:02 -07:00
|
|
|
# Build site with Hugo
|
|
|
|
hugo $extraFlags
|
2020-04-07 17:52:27 -07:00
|
|
|
|
|
|
|
# Output result
|
|
|
|
mkdir $out
|
2020-09-02 17:03:02 -07:00
|
|
|
cp -r public/$publicPath/* $out/
|
|
|
|
|
|
|
|
# Render math in HTML and XML files.
|
2020-12-14 19:16:27 -08:00
|
|
|
node $server &
|
2020-12-14 20:48:03 -08:00
|
|
|
sleep 1
|
2020-09-02 17:03:02 -07:00
|
|
|
find $out/ -regex "$out/.*\.html" | xargs ruby $converter
|