Skip to content

fix: resolve template and frontmatter errors for hugo 0.123 compatibi…#497

Open
hemantch01 wants to merge 1 commit into
volcano-sh:masterfrom
hemantch01:fix/hugo-0.123-compatibility
Open

fix: resolve template and frontmatter errors for hugo 0.123 compatibi…#497
hemantch01 wants to merge 1 commit into
volcano-sh:masterfrom
hemantch01:fix/hugo-0.123-compatibility

Conversation

@hemantch01
Copy link
Copy Markdown

@hemantch01 hemantch01 commented May 10, 2026

  • The commit message follows our guidelines
  • What kind of change does this PR introduce?
    /kind bug

  • What this PR does / why we need it:
    Upgrades the repository to compile successfully on modern versions of Hugo (v0.123+). Previously, attempting to run hugo server -D on a modern compiler caused fatal crashes due to:

  • Strict TOML parsing errors in legacy blog posts (e.g. dateday = 0X).
  • An invalid markdown URL syntax in the v1.11 release blog.
  • Deprecated template variables (.Hugo.Generator, .RSSLink, .Language.ContentDir, .UniqueID, .Dir).

This PR patches all templates and blog posts to ensure new contributors can build the website locally.

Screenshot 2026-05-10 150238 Screenshot 2026-05-10 150303

…lity

Signed-off-by: hemantch01 <hemantchaudhary905@gmail.com>
@volcano-sh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign k82cn for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot
Copy link
Copy Markdown
Collaborator

Welcome @hemantch01! It looks like this is your first PR to volcano-sh/website 🎉

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 10, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates Hugo template logic to use modern properties, such as hugo.Generator and .File.Dir, and standardizes blog post metadata by removing leading zeros from dates. It also configures syntax highlighting and improves RSS link generation. A significant regression was identified in the documentation sidebar where switching to section-based menu naming breaks navigation for versioned documentation; a suggestion was provided to derive the menu name from the file directory instead.

@@ -1,5 +1,5 @@
{{ $current_page := . }}
{{ $menu_name := (path.Base (path.Split .Path).Dir) }}
{{ $menu_name := .Section | default "docs" }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The change from directory-based menu naming to .Section introduces a regression for versioned documentation. In this project, different versions of documentation are stored in subdirectories (e.g., content/en/docs/v1-7-0/) and rely on the directory name to identify their specific menu (e.g., [[menu.v1-7-0]]). By forcing $menu_name to .Section ("docs"), all versions will now attempt to load the same "docs" menu, which will break the sidebar navigation for versioned content.

To maintain the original logic while avoiding the deprecated .Path variable, you should derive the menu name from the file's directory with a fallback to the section name.

Suggested change
{{ $menu_name := .Section | default "docs" }}
{{ $menu_name := .Section }}{{ with .File }}{{ $menu_name = path.Base .Dir }}{{ end }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Website fails to build locally on modern Hugo versions (v0.123+) due to template deprecations and strict TOML parsing

2 participants