Skip to content
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

Hugo generates "+50" timezone in sitemap when the sitemap template specifies +10 timezone #12495

Closed
xuhdev opened this issue May 15, 2024 · 1 comment

Comments

@xuhdev
Copy link

xuhdev commented May 15, 2024

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.126.0-32c967551be308fbd14e5f0dfba0ff50a60e7f5e+extended linux/amd64 BuildDate=2024-05-14T13:24:11Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes.

Details

To reproduce:

  1. Download the test site: test.tar.gz. The test site contains layouts/_defaults/sitemap.xml, which is same as the embedded sitemap template, with -07:00 replaced with +10:00.
  2. Run hugo inide the unarchived directory.
  3. public/sitemap.xml contains this line: <lastmod>2024-05-14T19:08:54+50:00</lastmod>, a +50 timezone.
@jmooring
Copy link
Member

<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05+10:00" ) }}</lastmod>

The above is nonsensical. If you want to include an offset in a layout string it must be 07:00.

Again, this is not a bug, but a conceptual disconnect. Please use the forum (https://discourse.gohugo.io/) for questions and troubleshooting.

@gohugoio gohugoio locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants