From 0468a6146b3124e2e120c796d3646c13e4e7f586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20=C4=8Cech?= Date: Fri, 17 Jul 2026 17:11:21 +0200 Subject: [PATCH] Upgrade Hugo to 0.164.0 Replace template constructs removed since 0.119 (getJSON, .Site.IsServer, .Site.GoogleAnalytics/.Site.DisqusShortname, nil-File comparison), shadow Docsy 0.7.1's swagger/list.html whose parse-error typo Hugo >= 0.146 rejects, and allow Node fs reads for the PostCSS sandbox introduced in 0.161 (browserslist probes ancestor directories). Pin 0.164.0 in netlify.toml and hugo-extended, refresh caniuse-lite, and fix deprecated config/front-matter keys (taxonomyTerm, languageName, cascade._target). Templates stay compatible with Hugo >= 0.120 for module consumers; module.hugoVersion.min and theme min_version bumped accordingly. Co-Authored-By: Claude Fable 5 --- config.toml | 14 +- docs/_index.md | 6 +- docs/pages/docs-homepage.md | 2 +- layouts/_default/content.html | 2 +- layouts/api-reference/content.html | 2 +- layouts/docs/list.html | 4 +- layouts/home.html | 4 +- layouts/partials/footer.html | 9 +- layouts/partials/head-css.html | 2 +- layouts/partials/section-index.html | 2 +- layouts/swagger/list.html | 28 + netlify.toml | 4 + package-lock.json | 2113 +++------------------------ package.json | 7 +- theme.toml | 2 +- 15 files changed, 277 insertions(+), 1924 deletions(-) create mode 100644 layouts/swagger/list.html diff --git a/config.toml b/config.toml index 50c5424..b05c74b 100644 --- a/config.toml +++ b/config.toml @@ -11,7 +11,7 @@ canonifyURLs = true # Disable, it makes problems with Netlify (missing internal redirect .../path -> .../path/) # relativeURLs = true -disableKinds = ["taxonomy", "taxonomyTerm"] +disableKinds = ["taxonomy", "term"] # Highlighting config pygmentsCodeFences = true @@ -54,7 +54,7 @@ section = [ "HTML" ] [languages] [languages.en] title = "GoodData Docs Theme" -languageName = "English" +label = "English" # Weight used for sorting. weight = 1 @@ -161,12 +161,20 @@ notAlternative = true [security] [security.funcs] getenv = ["^HUGO_", "^hugo_"] + # Hugo >= 0.161 runs PostCSS under the Node.js permission model with reads + # confined to the project dir. Browserslist probes every ancestor directory + # (package.json, browserslist-stats.json), so reads must stay unrestricted; + # write/child-process/addon restrictions remain at their defaults. + [security.node.permissions] + allowRead = ["*"] [module] proxy = "direct" [module.hugoVersion] extended = true - min = "0.81.0" + # Templates use hugo.IsServer / .Site.Config.Services (Hugo >= 0.120); + # tested with Hugo 0.164.0. + min = "0.120.0" [[module.imports]] path = "github.com/google/docsy" disable = false diff --git a/docs/_index.md b/docs/_index.md index 448c54c..a207835 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -5,15 +5,15 @@ weight: 1 cascade: - type: "docs" toc_root: true - _target: + target: path: "/*" - type: "docs" toc_root: true - _target: + target: path: "/*/**" - type: "docs" toc_root: true - _target: + target: path: "/_index.md" --- diff --git a/docs/pages/docs-homepage.md b/docs/pages/docs-homepage.md index 7801088..cbe1520 100644 --- a/docs/pages/docs-homepage.md +++ b/docs/pages/docs-homepage.md @@ -9,7 +9,7 @@ layout: "list" cascade: - type: "docs" toc_root: true - _target: + target: path: "/*/**" --- diff --git a/layouts/_default/content.html b/layouts/_default/content.html index abbfc62..4ae1b56 100644 --- a/layouts/_default/content.html +++ b/layouts/_default/content.html @@ -14,7 +14,7 @@

{{ .Title }}

{{ if and .Params.sectionIndex .Parent }} {{ partial "section-index.html" .Parent }} {{ end }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.Config.Services.GoogleAnalytics.ID)) }} {{ partial "feedback.html" .Site.Params.ui.feedback }}
{{ end }} diff --git a/layouts/api-reference/content.html b/layouts/api-reference/content.html index fe2edd9..996a268 100644 --- a/layouts/api-reference/content.html +++ b/layouts/api-reference/content.html @@ -10,7 +10,7 @@

{{ .Title }}

{{ if and .Params.sectionIndex .Parent }} {{ partial "section-index.html" .Parent }} {{ end }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.Config.Services.GoogleAnalytics.ID)) }} {{ partial "feedback.html" .Site.Params.ui.feedback }}
{{ end }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html index 813d67f..712bf74 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -14,14 +14,14 @@

{{ .Title }}

{{ if ne .Params.sectionIndex false }} {{ partial "section-index.html" . }} {{ end }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.Config.Services.GoogleAnalytics.ID)) }} {{ partial "feedback.html" .Site.Params.ui.feedback }}
{{ end }} {{ partial "prev-next-pages.html" . }} - {{ if (.Site.DisqusShortname) }} + {{ if (.Site.Config.Services.Disqus.Shortname) }}
{{ partial "disqus-comment.html" . }} {{ end }} diff --git a/layouts/home.html b/layouts/home.html index b533476..d15176c 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -26,14 +26,14 @@

{{.Title}}

{{ if ne .Params.sectionIndex false }} {{ partial "section-index.html" . }} {{ end }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.Config.Services.GoogleAnalytics.ID)) }} {{ partial "feedback.html" .Site.Params.ui.feedback }}
{{ end }} {{ partial "prev-next-pages.html" . }} - {{ if (.Site.DisqusShortname) }} + {{ if (.Site.Config.Services.Disqus.Shortname) }}
{{ partial "disqus-comment.html" . }} {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 1402076..e7cb209 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,12 @@ {{/* (C) 2026 GoodData Corporation */}} -{{ $footer := getJSON "https://www.gooddata.ai/learn-assets/js/footer-definition-new.json" }} +{{/* A failed fetch fails the build, matching the old getJSON behavior. */}} +{{ $footerURL := "https://www.gooddata.ai/learn-assets/js/footer-definition-new.json" }} +{{ $footer := dict }} +{{ with resources.GetRemote $footerURL }} + {{ $footer = . | transform.Unmarshal }} +{{ else }} + {{ errorf "footer.html: unable to fetch %s" $footerURL }} +{{ end }} {{ if not .Site.Params.whitelabeled }}