doc: drop the special sha for the hugo theme, update hugo instead

The special sha is no longer needed, let's bump to a recent version of
hugo instead and that should make it all work nicely (for a while).

Updating hugo requires changing to hugo.toml and forcing mermaid to be
enabled, without those changes the build failed with
 `failed to extract shortcode: template for shortcode "mermaid" not found`

This reverts commit 5909717700

Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/358>
This commit is contained in:
Peter Hutterer 2023-12-13 17:41:16 +10:00
parent 4f11112be0
commit 2671079754
5 changed files with 8 additions and 14 deletions

View file

@ -365,7 +365,7 @@ fedora:42@doc-build:
script:
# Staying up-to-date with the breakages between hugo and the relearn theme is annoying
# so let's lock the version for our doc build
- go install "github.com/gohugoio/hugo@v0.111"
- go install "github.com/gohugoio/hugo@v0.142"
- export PATH="$HOME/go/bin:$PATH"
- .gitlab-ci/meson-build.sh
- rm -rf public/

View file

@ -378,7 +378,7 @@ minimum-meson@{{distro.name}}:{{version}}:
script:
# Staying up-to-date with the breakages between hugo and the relearn theme is annoying
# so let's lock the version for our doc build
- go install "github.com/gohugoio/hugo@v0.111"
- go install "github.com/gohugoio/hugo@v0.142"
- export PATH="$HOME/go/bin:$PATH"
- .gitlab-ci/meson-build.sh
- rm -rf public/

View file

@ -7,12 +7,6 @@ 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)
@ -63,13 +57,10 @@ if [[ -e "$SITEDIR" ]]; then
echo "$SITEDIR already exists, updating"
else
hugo new site "$SITEDIR"
git clone 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
git clone --depth=1 https://github.com/McShelby/hugo-theme-relearn "$SITEDIR/themes/hugo-theme-relearn"
fi
cp "$TEMPLATEDIR/config.toml" "$SITEDIR/"
cp "$TEMPLATEDIR/hugo.toml" "$SITEDIR/"
pushd "$TEMPLATEDIR" > /dev/null || exit 1
find . -type f -name "*.md"

View file

@ -19,3 +19,6 @@ name = "<i class='fas fa-bug'></i> Report a Bug"
identifier = "bugs"
url = "https://gitlab.freedesktop.org/libinput/libei/-/issues/"
weight = 10
[params]
mermaid = true

View file

@ -12,7 +12,7 @@ src_script = files('generate-protocol-docs.sh')
hugo_script = find_program(src_script)
src_hugo = files(
'config.toml',
'hugo.toml',
'interface.md.tmpl',
) + src_script