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

With unquoted TOML values, GroupByParamDate requires fully qualified date #11563

Closed
jmooring opened this issue Oct 13, 2023 · 1 comment · Fixed by #11706
Closed

With unquoted TOML values, GroupByParamDate requires fully qualified date #11563

jmooring opened this issue Oct 13, 2023 · 1 comment · Fixed by #11706
Assignees

Comments

@jmooring
Copy link
Member

jmooring commented Oct 13, 2023

The unexpected behavior is limited to unquoted TOML values.

GroupByParamDate "eventDate" "2006-01"works fine with all of these:

title = 'something'
eventDate = 2022-08-13T13:57:43-07:00   # unquoted 
title = 'something'
eventDate = '2022-08-13T13:57:43-07:00'   # quoted 
title = 'something'
eventDate = '2022-08-13'  # quoted 

But pages with this parameter date format are not grouped:

title = 'something'
eventDate = 2022-08-13  # unquoted 

GroupByDate, GroupByExpiryDate, GroupByLastmod, and GroupByPublishDate work fine any of the four date values.

In that unquoted TOML dates are the best choice1 for custom date params, this seems like something we should fix.


Reproducible example:

git clone --single-branch -b hugo-github-issue-11563 https://github.com/jmooring/hugo-testing hugo-github-issue-11563
cd hugo-github-issue-11563
hugo server

Footnotes

  1. With unquoted TOML dates you can do time.Time comparisons wit the where function.

@jmooring jmooring changed the title GroupByParamDate requires fully qualified time date With unquoted TOML values, GroupByParamDate requires fully qualified date Oct 13, 2023
@jmooring jmooring self-assigned this Nov 13, 2023
jmooring added a commit to jmooring/hugo that referenced this issue Nov 13, 2023
jmooring added a commit to jmooring/hugo that referenced this issue Nov 16, 2023
jmooring added a commit to jmooring/hugo that referenced this issue Nov 16, 2023
jmooring added a commit to jmooring/hugo that referenced this issue Nov 17, 2023
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 Dec 14, 2023
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.

1 participant