From e8032e70e7d10142cdd59f38c8353a8eb3d6eab7 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Mon, 24 Nov 2025 19:09:24 +0100 Subject: [PATCH] hugo: bump version to 0.147.8, address deprecations This change bumps the Hugo version used to build web pages to v0.147.8 and addresses build issues introduced by functions deprecated in newer hugo versions: - .Site.IsMultiLingual => hugo.IsMultilingual - resources.ToCSS => css.Sass Templates and partials that use deprecated functions are now overridden in layout/. Lastly, symlink from content/ to the Readme was removed as Hugo does noti support symlinks anymore, and replaced by "mounts" in config.toml. The Hugo version was bumped in gh-pages.yml. Signed-off-by: Thilo Fromm --- .github/workflows/gh-pages.yml | 2 +- website/config.toml | 5 +++ website/content/_index.md | 1 - website/layouts/404.html | 35 ++++++++++++++++ website/layouts/partials/docs/footer.html | 2 +- website/layouts/partials/docs/html-head.html | 43 ++++++++++++++++++++ 6 files changed, 85 insertions(+), 3 deletions(-) delete mode 120000 website/content/_index.md create mode 100644 website/layouts/404.html create mode 100644 website/layouts/partials/docs/html-head.html diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index be3ac32..7c33ca7 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.104.3' + hugo-version: '0.147.8' extended: true - name: Build diff --git a/website/config.toml b/website/config.toml index 21c13b7..23c9dd1 100644 --- a/website/config.toml +++ b/website/config.toml @@ -31,3 +31,8 @@ theme = "hugo-book" BookCommitPath = 'commit' BookEditPath = 'edit/main' BookIndexPage = 'README.md' + +[modules] + [[module.mounts]] + source = '../README.md' + target = 'content/_index.md' diff --git a/website/content/_index.md b/website/content/_index.md deleted file mode 120000 index fe84005..0000000 --- a/website/content/_index.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file diff --git a/website/layouts/404.html b/website/layouts/404.html new file mode 100644 index 0000000..60dcdc6 --- /dev/null +++ b/website/layouts/404.html @@ -0,0 +1,35 @@ + + + + + {{ partial "docs/html-head" . }} + {{ partial "docs/inject/head" . }} + + + + + +
+
+

404

+

Page Not Found

+

+ {{ .Site.Title }} +

+
+
+ + {{ partial "docs/inject/body" . }} + {{ template "_internal/google_analytics.html" . }} + + + diff --git a/website/layouts/partials/docs/footer.html b/website/layouts/partials/docs/footer.html index 5aa5a07..defbd70 100644 --- a/website/layouts/partials/docs/footer.html +++ b/website/layouts/partials/docs/footer.html @@ -1,5 +1,5 @@
-{{ if .Site.IsMultiLingual }} +{{ if hugo.IsMultilingual }} {{ partial "docs/languages" . }} {{ end }} diff --git a/website/layouts/partials/docs/html-head.html b/website/layouts/partials/docs/html-head.html new file mode 100644 index 0000000..b24730d --- /dev/null +++ b/website/layouts/partials/docs/html-head.html @@ -0,0 +1,43 @@ + + + + + +{{- template "_internal/opengraph.html" . -}} + +{{ partial "docs/title" . }} | {{ .Site.Title -}} + +{{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }} + + + +{{- range .Translations }} + +{{ end -}} + + +{{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | css.Sass | resources.Minify | resources.Fingerprint }} + + +{{- if default true .Site.Params.BookSearch }} +{{- $searchJSFile := printf "%s.search.js" .Language.Lang }} +{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }} + +{{ end -}} + +{{- if .Site.Params.BookServiceWorker }} +{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }} + +{{ end -}} + +{{- template "_internal/google_analytics.html" . -}} + + +{{- with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{ end -}} + +{{ "" | safeHTML }}