Harden Hugo builds and vendor Congo theme - #18
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e76d943b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </thead> | ||
| <tbody> | ||
| {{- range .Site.Data.books.books }} | ||
| {{- range hugo.Data.books.books }} |
There was a problem hiding this comment.
Use
site.Data when reading Hugo data files
Switching this shortcode from .Site.Data to hugo.Data breaks data lookups because Hugo exposes data files through the site object (site.Data), not the global hugo object. When content/books/index.md (and similarly content/movies/index.md) renders this shortcode, template evaluation will fail or return no rows, which blocks the page build/output. Use site.Data here (and in movie-table.html) to preserve the deprecation-safe access pattern without breaking rendering.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I checked the current Hugo docs before changing this. Site.Data is deprecated as of Hugo v0.156.0, and the documented replacement is hugo.Data: https://gohugo.io/methods/site/data/ and https://gohugo.io/functions/hugo/data/ . Hugo also explicitly notes that hugo.Data is the project-level replacement for Site.Data: https://discourse.gohugo.io/t/deprecations-in-v0-156-0/56732 .
I also re-ran the site build on this branch with the shortcode using hugo.Data, and it still renders successfully (./scripts/hugo.sh --minify --buildFuture). So I am not making a code change here, because reverting to site.Data would reintroduce the deprecation we were fixing.
There was a problem hiding this comment.
Follow-up after checking the failing Actions run: the bug report was directionally right about this PR as submitted, but the root cause is version skew rather than hugo.Data itself.
hugo.Data is the correct replacement on modern Hugo, but this branch was still pinning CI to Hugo 0.149.0, which predates that API. I have now updated the branch to pin Hugo 0.160.1 via .hugo-version, which matches the deprecation-safe shortcode changes and the version I verified locally with ./scripts/hugo.sh --minify --buildFuture.
So the fix is to move the pinned Hugo version forward, not to revert back to deprecated Site.Data.
…ening # Conflicts: # .github/workflows/hugo.yml # .github/workflows/pr-validation.yml
Summary
Testing