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

Zero dates in section with content file with valid dates #5854

Closed
brycewray opened this issue Apr 13, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@brycewray
Copy link

commented Apr 13, 2019

Each of my posts uses {{ .Date.Format "January 2, 2006" }} to produce “Published” and {{ .Lastmod.Format "January 2, 2006" }} to produce (if applicable) “Last modified” info at the top of the page. Starting with Hugo 0.55.0 and continuing with 0.55.1, that works fine on my local Hugo install for a regular post but the same code on my site’s “About me” page outputs "0001-01-01 00:00:00 +0000 UTC" for both parameters. Even odder: putting a bogus .md file in the /content/about/ directory solved this problem on-screen yet the output for the date and lastmod was coming from that file's front matter, not from the /content/about/_index.md file, although the remainder of the correct file's content was shown as usual.

Public repo for examination:
https://github.com/brycewray/hugo_site_css-grid

Related thread in the Hugo forums:
https://discourse.gohugo.io/t/hugo-0-55-0-date-appears-as-january-1-0001/18029

Page working normally under, still, 0.54.0:
https://brycewray.com/about/

(My first-ever GitHub bug report; I apologize in advance if I missed anything or, on the other hand, gave too much info.)

@brycewray brycewray changed the title 0.55.x -- date appears as "0001-01-01 00:00UTC" 0.55.x -- date appears as "00001-01-01 00:00:00 +0000 UTC" Apr 13, 2019

@brycewray brycewray changed the title 0.55.x -- date appears as "00001-01-01 00:00:00 +0000 UTC" 0.55.x -- date appears as "0001-01-01 00:00:00 +0000 UTC" Apr 13, 2019

@bep bep added the Bug label Apr 13, 2019

@bep bep self-assigned this Apr 13, 2019

@bep bep added this to the v0.55.2 milestone Apr 13, 2019

@bep bep changed the title 0.55.x -- date appears as "0001-01-01 00:00:00 +0000 UTC" Zero dates in section with content file with valid dates Apr 13, 2019

@bep

This comment has been minimized.

Copy link
Member

commented Apr 13, 2019

A bug, alright. For sections, it looks for the date in the sections' pages, even if the date is set in front matter.

bep added a commit to bep/hugo that referenced this issue Apr 13, 2019

@bep bep closed this in #5856 Apr 13, 2019

bep added a commit that referenced this issue Apr 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.