website icon indicating copy to clipboard operation
website copied to clipboard

[BugFix]: Remove leading zeros from dateday in TOML front matter

Open lakxy opened this issue 10 months ago • 7 comments

Description

Removes leading zeros from dateday values in blog post TOML front matter to comply with TOML v1.0.0 specification.

Why This Change is Needed

The Problem:

  • Blog posts contain dateday = 01, dateday = 07 etc. in TOML front matter
  • Leading zeros violate TOML v1.0.0 spec (ambiguous with octal notation)
  • Hugo v0.123.7+ fails to build: Error: unmarshal failed: toml: expected newline
  • Blocks local development with modern Hugo and future version upgrades

The Fix:

  • Change dateday = 07 → dateday = 7 (remove leading zeros)
  • Backward compatible with Hugo v0.57.2 (current version in netlify.toml)
  • Enables modern Hugo usage and future upgrades

Checklist

  • [x] Commit message follows guidelines
  • [x] Tested with Hugo v0.57.2 and v0.123.7+

Type of Change

/kind bug

Which Issue(s) This PR Fixes

Fixes #448

lakxy avatar Jan 21 '26 11:01 lakxy

[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.

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 avatar Jan 21 '26 11:01 volcano-sh-bot

Summary of Changes

Hello @codeEvolveZenith345, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical compatibility issue preventing the use of newer Hugo versions for building blog posts. It standardizes the dateday format within the TOML front matter of various markdown files by removing leading zeros, thereby adhering to the TOML v1.0.0 specification. This ensures that the site can be built successfully with modern Hugo, while maintaining compatibility with the currently deployed version, and paves the way for future tooling updates.

Highlights

  • TOML Specification Compliance: Leading zeros have been removed from dateday values in blog post TOML front matter to comply with the TOML v1.0.0 specification, which considers leading zeros ambiguous with octal notation.
  • Hugo Build Fix: This change resolves a critical build error (Error: unmarshal failed: toml: expected newline) encountered when using Hugo v0.123.7+ due to the aforementioned TOML non-compliance.
  • Backward Compatibility: The fix is backward compatible with Hugo v0.57.2, which is the current version used in netlify.toml, ensuring no regressions for existing deployments.
  • Enabling Modern Hugo: By addressing this issue, the pull request enables the use of modern Hugo versions and facilitates future upgrades, unblocking local development.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist avatar Jan 21 '26 11:01 gemini-code-assist

/cc @Arhell Apologies for bothering you, but could you please review->approve this minimal bug fix?

lakxy avatar Jan 21 '26 11:01 lakxy

/cc @Arhell Apologies for bothering you, but could you please review->approve this minimal bug fix?

This bug caused hugo to crash on local development.

lakxy avatar Jan 21 '26 11:01 lakxy

  • Hugo v0.123.7+ fails to build: Error: unmarshal failed: toml: expected newline

The thing is that site runs on Hugo version 0.57.0. I have tested the build on that version of Hugo and the build completed without errors.

aniketchawardol avatar Feb 03 '26 16:02 aniketchawardol

  • Hugo v0.123.7+ fails to build: Error: unmarshal failed: toml: expected newline The thing is that site runs on Hugo version 0.57.0. I have tested the build on that version of Hugo and the build completed without errors.

I think the behavior must be uniform. If it is in all other occurrences/instances, it should be replicated/made uniform. That is the motive of this PR, to make the contributors test changes with ease!

lakxy avatar Feb 03 '26 16:02 lakxy

/cc @JesseStutler Please review/approve!

lakxy avatar Feb 04 '26 08:02 lakxy