doc: use a specific revision of the hugo template

Upstream commit 1250bf30a8c2e3c1bfac285489bc63f2c395b641 somehow breaks
things. Doesn't affect hugo v0.111 (F39) but it does break on F38 on
v0.101.

Let's not waste more time debugging this, hardcode the template and in a
few weeks time we can switch to F39 as the build host.
This commit is contained in:
Peter Hutterer 2023-10-11 13:02:46 +10:00
parent 43b383ebdb
commit 5909717700

View file

@ -7,6 +7,12 @@ REPO_BASE_DIR="$PWD"
OUTDIR="$PWD"
SITENAME="ei"
# This can be dropped once we update to Fedora 39, the current F38
# version of hugo triggers errors with anything after
# hugo-theme-relearn 1250bf30a8c2e3c1bfac285489bc63f2c395b641
# ERROR 2023/10/11 02:57:59 render of "page" failed: "/root/libei/build/doc/protocol/ei/themes/hugo-theme-relearn/layouts/_default/single.html:1:4": execute of template failed: template: _default/single.html:1:4: executing "_default/single.html" at <partial "_main.hugo" .>: error calling partial: "/root/libei/build/doc/protocol/ei/themes/hugo-theme-relearn/layouts/partials/_main.hugo:1:4": execute of template failed: template: partials/_main.hugo:1:4: executing "partials/_main.hugo" at <partialCached "page-meta.hugo" . .RelPermalink>: error calling partialCached: "/root/libei/build/doc/protocol/ei/themes/hugo-theme-relearn/layouts/partials/page-meta.hugo:11:123": execute of template failed: template: partials/page-meta.hugo:11:123: executing "partials/page-meta.hugo" at <index .Site.Params $disable>: error calling index: index of untyped nil
TEMPLATE_SHA=aa0f4089cb9c7691e7dc3aff003dddcde1ba02f4
while [[ $# -gt 0 ]]; do
case "$1" in
--verbose | -v)
@ -57,7 +63,10 @@ if [[ -e "$SITEDIR" ]]; then
echo "$SITEDIR already exists, updating"
else
hugo new site "$SITEDIR"
git clone --depth=1 https://github.com/McShelby/hugo-theme-relearn "$SITEDIR/themes/hugo-theme-relearn"
git clone --depth=50 https://github.com/McShelby/hugo-theme-relearn "$SITEDIR/themes/hugo-theme-relearn"
pushd "$SITEDIR/themes/hugo-theme-relearn" > /dev/null || exit 1
git reset --hard $TEMPLATE_SHA
popd > /dev/null || exit 1
fi
cp "$TEMPLATEDIR/config.toml" "$SITEDIR/"