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

String "date" in an archetype field comment suppresses warning when date field missing #4504

Closed
rajeshduggal opened this issue Mar 15, 2018 · 2 comments
Labels
Milestone

Comments

@rajeshduggal
Copy link

Having these fields in archetypes/about.md and running "hugo new about/about.md" in hugo 0.37.1 results in a warning message about "date and/or title missing from archetype file". Great!

title = "about us"
description = "about this site"
Date = {{ .Date }}

But having a comment after a field with the string "date" in it results in the warning not being displayed.
e.g. Date = {{ .Date }} # the date

I expected the warning to display only based on the field names. i.e. variables before the equal signs.

@rajeshduggal rajeshduggal changed the title Archetype warning not displayed when "date" field missing but "date" string found in a field comment String "date" in an archetype field comment suppresses warning when date field missing Mar 15, 2018
@bep
Copy link
Member

bep commented Mar 15, 2018

We do not parse the front matter (we did in earlier versions with lots of other surprising issues). So this validation is just a simple "check for the strings date or title." It was added because earlier we added title/date if they were missing.

I will fix this, but maybe not in the way you think.

@github-actions
Copy link

github-actions bot commented Mar 6, 2022

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 Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants