From 267107975414448dc10bb5c700b81f36e3ccd30d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 13 Dec 2023 17:41:16 +1000 Subject: [PATCH] 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 5909717700aead940f3b328451c2c85755d3a518 Part-of: --- .gitlab-ci.yml | 2 +- .gitlab-ci/ci.template | 2 +- doc/protocol/generate-protocol-docs.sh | 13 ++----------- doc/protocol/{config.toml => hugo.toml} | 3 +++ doc/protocol/meson.build | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) rename doc/protocol/{config.toml => hugo.toml} (96%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c33383..a65fb82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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/ diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index b97bc5e..3c6c9f3 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -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/ diff --git a/doc/protocol/generate-protocol-docs.sh b/doc/protocol/generate-protocol-docs.sh index 029ff1b..99f48c5 100755 --- a/doc/protocol/generate-protocol-docs.sh +++ b/doc/protocol/generate-protocol-docs.sh @@ -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 : 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 : 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 : 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" diff --git a/doc/protocol/config.toml b/doc/protocol/hugo.toml similarity index 96% rename from doc/protocol/config.toml rename to doc/protocol/hugo.toml index 798e163..a3a405a 100644 --- a/doc/protocol/config.toml +++ b/doc/protocol/hugo.toml @@ -19,3 +19,6 @@ name = " Report a Bug" identifier = "bugs" url = "https://gitlab.freedesktop.org/libinput/libei/-/issues/" weight = 10 + +[params] +mermaid = true diff --git a/doc/protocol/meson.build b/doc/protocol/meson.build index 87c9e57..2033f54 100644 --- a/doc/protocol/meson.build +++ b/doc/protocol/meson.build @@ -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