gjtorikian / jekyll-last-modified-at

A Jekyll plugin to show the last_modified_at time of a post.
MIT License
241 stars 38 forks source link

Consider page dependencies? #94

Open maul-esel opened 1 year ago

maul-esel commented 1 year ago

I have several pages in my site, whose content is generated based on YAML data in _data, or which display the items of a collection. Currently, only changes to the page source itself are reflected by page.last_modified_at. I would like page.last_modified_at to reflect when the page content changes due to changes in the underlying data / collection (such that the jekyll-sitemap plugin generates correct <lastmod> tags).

Is this feature currently supported, or planned?

If it's not yet supported, I would be willing to take a look into this issue myself, if you could give me some guidance.

maul-esel commented 1 year ago

I have a minimal draft of the first variant (explicitly specifying dependencies): https://github.com/gjtorikian/jekyll-last-modified-at/compare/master...maul-esel:jekyll-last-modified-at:specify-dependencies

Usage:

---
lastmod_dependencies:
  collections: ['people'] # names of collections
  data: ['bla'] # names of files in `_data`, not including the .yml extension
---

The second variant (using jekyll's dependency tracking) seems a bit farther off, after some investigation: