Skip to content

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

Merged
merged 2 commits into from
May 13, 2025

Conversation

afbjorklund
Copy link
Member

@jandubois
Copy link
Member

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/

@afbjorklund
Copy link
Member Author

afbjorklund commented May 13, 2025

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 Makefile?

@jandubois
Copy link
Member

You need to install the supported hugo version from the npm install (package.json), not the latest/greatest

Thanks, that works. I think it needs at very least a comment in website/Makefile. Ideally the npm scripts would download and use the exact version they need if they can't work with the latest version.

jandubois
jandubois previously approved these changes May 13, 2025
Copy link
Member

@jandubois jandubois left a 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

@afbjorklund
Copy link
Member Author

afbjorklund commented May 13, 2025

The Makefile was my attempt to make it a little easier, we can probably add a pre-requisite line.

It also needs to document how to use nvm to get the right version of node.js, so it can get hairy.

It's plain awful on Windows, but that's another story... (moral of it being: use Linux, WSL FTW!)

@jandubois jandubois linked an issue May 13, 2025 that may be closed by this pull request
@jandubois
Copy link
Member

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]>
@afbjorklund
Copy link
Member Author

afbjorklund commented May 13, 2025

I think the local version takes predence over any system version, I installed hugo 0.145.0 and it still worked

$ hugo version
hugo v0.145.0-666444f0a52132f9fec9f71cf25b441cc6a4f355+extended linux/amd64 BuildDate=2025-02-26T15:41:25Z VendorInfo=gohugoio

Start building sites …
hugo v0.133.1-47d00202e7e61769ce4d14691e43b27852c9cce4+extended linux/amd64 BuildDate=2024-08-26T13:58:46Z VendorInfo=gohugoio

It does have to download a few things, but for a node program it is not "too bad" (there are much worse)

95M node_modules/

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@afbjorklund
Copy link
Member Author

afbjorklund commented May 13, 2025

The new version does have some subtle improvements, and one "moderate security vulnerability" fixed.

OLD
lima-docs-old
NEW
lima-docs-new

# npm audit report

nanoid  <3.3.8
Severity: moderate
Predictable results in nanoid generation when given non-integer values - https://github.com/advisories/GHSA-mwcw-c2x4-8c55
fix available via `npm audit fix`
node_modules/nanoid

1 moderate severity vulnerability

@jandubois
Copy link
Member

I think the local version takes predence over any system version, I installed hugo 0.145.0 and it still worked

Looks like I forgot to run npm install before running make serve.

It does have to download a few things, but for a node program it is not "too bad" (there are much worse)

95M node_modules/

tfugj4n3l6ez

@jandubois jandubois merged commit 3014d01 into lima-vm:master May 13, 2025
9 checks passed
@AkihiroSuda AkihiroSuda added this to the v1.1.0 milestone May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hugo/docsy issue when trying to preview website changes
3 participants