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 · 3 comments · Fixed by #5856
Closed

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

brycewray opened this issue Apr 13, 2019 · 3 comments · Fixed by #5856
Assignees
Milestone

Comments

@brycewray
Copy link

brycewray 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
Copy link
Member

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

@divya-binil
Copy link

Is this issue fixed?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants