Skip to content

Harden Hugo builds and vendor Congo theme - #18

Merged
cloudartisan merged 3 commits into
mainfrom
codex/hugo-build-hardening
Apr 12, 2026
Merged

Harden Hugo builds and vendor Congo theme#18
cloudartisan merged 3 commits into
mainfrom
codex/hugo-build-hardening

Conversation

@cloudartisan

Copy link
Copy Markdown
Owner

Summary

  • vendor the Congo theme so normal builds no longer depend on live Hugo module downloads or a Go toolchain
  • add a small Hugo wrapper and repo-local cache path, and update GitHub Actions to use the vendored build path
  • refresh the repo documentation for the supported macOS/Linux setup and replace deprecated Hugo data access in local shortcodes

Testing

  • ./scripts/hugo.sh config
  • ./scripts/hugo.sh --buildDrafts --buildFuture
  • ./scripts/hugo.sh --minify --buildFuture

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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
@cloudartisan
cloudartisan merged commit 2864940 into main Apr 12, 2026
4 checks passed
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.

1 participant