For the three posts I set publishDate in the front matter, because I want to display this on the website.
Now when I access the lastmod of either of the parent page bundles (posts/_index.md and _index.md) I expect them to not be set to anything. (Since I didn’t set any date for these files by hand and don’t have the git thing enabled.) However, they are set, from the publishDate of the descendents!
Is this intended? I couln’t find anything about this on the documentation. How do I disable this? I want independent dates for index pages.
Sorry, I don’t see how this should help. I know this page. I also know that lastmod can be inherited from publishDate. But from another (child) page?! There is no comment on that on the page you sent, if I’m not mistaken.
If you don’t set a date on section or home page, then is doesn’t have a date. We want (and sometimes need) a date for every page. In the absence of date on section or home page, we choose the most recent date in the section.
It is very confusing that date and lastmod (and others) fall back to each other circularly. For example, from the webpage you can see that:
publishDate falls back to date
date falls back to lastmod
In the example I sent, publishDate and date are both not set. So publishDate should be lastmod by the above chain. But you can see in the example that it isn’t.
It would be great to see whats actually going on under the hood, and in what order.
If you are trying to test this real time with hugo server, make sure you print to console with warnf because hugo server does not refresh in all situations.
Yeah I already realized that hugo server has difficulties with it. So I only test these things with usual builds.
I know the rules that you sent. As I said, they are circular, so they don’t tell you everything. You also need to know the order of execution. See my previous response.
For me it now works with lastmod = ['lastmod'], so you don’t need to waste more time on this. I just wanted to make people aware that the documentation doesn’t tell you everything:
it doesn’t tell you about inheritation (and I still don’t know which date is actually inherited)
it doesn’t tell you about the order of fall back executions