-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
In "original" Jekyll, it seems like page.date is only defined when it comes from the filename or front matter. In gojekyll, page.date always appears to be defined—even for ordinary, non-post pages that don't have an explicit date. This date comes from the source file's mtime. I believe that seems from the final fallback case here:
Lines 166 to 177 in f7b210e
| func (f *file) PostDate() time.Time { | |
| switch value := f.fm["date"].(type) { | |
| case time.Time: | |
| return value | |
| case string: | |
| t, err := evaluator.ParseDate(value) | |
| if err == nil { | |
| return t | |
| } | |
| } | |
| return f.modTime | |
| } |
Do you think it might be the right thing to do here to remove the final modTime case and to return some empty value instead? If so, I can put together a PR.
(The reason this came up for me is that I use {% if page.date %} in some templates to determine whether we're rendering a post. I could presumably use some other signal instead, but I'm not sure what. :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels