Like .Site.LastChange. Useful for constructing tag-URI-based id’s for pages in Atom feeds.
First changed regular page:
{{ (index site.RegularPages.ByLastmod 0).Lastmod }}
Last changed regular page:
{{ (index site.RegularPages.ByLastmod.Reverse 0).Lastmod }}
If you change RegularPages
to Pages
there will be pages in the collection that are not backed by a file, so… no dates. If you go that route, you’ll need to build your own collection.
2 Likes
Yep, I wrote a workaround in the meantime. I thought this would be a useful addition to Site, since it has LastChange too. You could write the same code for LastChange.
Also note that site.LastChange (soon to be site.LastModified) is a little bit broken, so this will be more accurate (excluding list pages, which I think is a good thing depending on how you look at it):
{{ (index site.RegularPages.ByLastmod.Reverse 0).Lastmod }}
2 Likes