-
Notifications
You must be signed in to change notification settings - Fork 669
Update docsy to version 0.11.0 and hugo to 0.133.1 #3538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
afbjorklund
commented
May 13, 2025
- Issue hugo/docsy issue when trying to preview website changes #3516
Signed-off-by: Anders F Björklund <[email protected]>
Doesn't work for me: > hugo --cleanDestinationDir -e dev -DFE --minify serve
Watching for changes in /Users/jan/{Library,suse}
Watching for config changes in /Users/jan/suse/lima/website/hugo.toml, /Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/hugo.yaml, /Users/jan/suse/lima/website/go.mod
Start building sites …
hugo v0.147.3+extended+withdeploy darwin/arm64 BuildDate=2025-05-12T12:25:03Z VendorInfo=brew
ERROR render of "/Users/jan/suse/lima/website/content/en/docs/config/network/_index.md" failed: "/Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/docs/baseof.html:33:7": execute of template failed: template: docs/list.html:33:7: executing "docs/list.html" at <partial "scripts.html" .>: error calling partial: "/Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/partials/scripts.html:73:4": execute of template failed: template: _partials/scripts.html:73:4: executing "_partials/scripts.html" at <partial "scripts/mermaid.html" .>: error calling partial: "/Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/partials/scripts/mermaid.html:5:10": execute of template failed: template: _partials/scripts/mermaid.html:5:10: executing "_partials/scripts/mermaid.html" at <.Err>: can't evaluate field Err in type resource.Resource
Built in 615 ms
Error: error building site: render: failed to render pages: render of "/Users/jan/suse/lima/website/content/en/docs/config/vmtype.md" failed: "/Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/docs/baseof.html:33:7": execute of template failed: template: docs/single.html:33:7: executing "docs/single.html" at <partial "scripts.html" .>: error calling partial: "/Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/partials/scripts.html:73:4": execute of template failed: template: _partials/scripts.html:73:4: executing "_partials/scripts.html" at <partial "scripts/mermaid.html" .>: error calling partial: "/Users/jan/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/partials/scripts/mermaid.html:5:10": execute of template failed: template: _partials/scripts/mermaid.html:5:10: executing "_partials/scripts/mermaid.html" at <.Err>: can't evaluate field Err in type resource.Resource: Resource.Err was removed in Hugo v0.141.0 and replaced with a new try keyword, see https://gohugo.io/functions/go-template/try/ |
You need to install the supported hugo version from the npm install (package.json), not the latest/greatest Unfortunately the tool is not backwards compatible... Maybe we can add a check for it, in the |
Thanks, that works. I think it needs at very least a comment in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
I would prefer to see some comments about installing the right hugo version in website/Makefile
, maybe even with a link to https://github.com/gohugoio/hugo/releases/tag/v0.133.1
How about this: --- website/Makefile
+++ website/Makefile
@@ -4,6 +4,7 @@
NPM ?= npm
build serve: _output/docsy
+ $(NPM) install
$(NPM) run $@
_output/docsy:
--- website/package.json
+++ website/package.json
@@ -11,7 +11,7 @@
"scripts": {
"_build": "npm run _hugo-dev",
"_check:links": "echo IMPLEMENTATION PENDING for check-links; echo",
- "_hugo": "hugo --cleanDestinationDir",
+ "_hugo": "./node_modules/.bin/hugo --cleanDestinationDir",
"_hugo-dev": "npm run _hugo -- -e dev -DFE",
"_serve": "npm run _hugo-dev -- --minify serve",
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", |
Docsy requires a specific older version of hugo. Signed-off-by: Anders F Björklund <[email protected]>
I think the local version takes predence over any system version, I installed hugo 0.145.0 and it still worked $ hugo version Start building sites … It does have to download a few things, but for a node program it is not "too bad" (there are much worse)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
The new version does have some subtle improvements, and one "moderate security vulnerability" fixed.
|