mitydigital / statamic-feedamic

An Atom and RSS feed for Statamic 3, 4 and 5
https://docs.mity.com.au/feedamic
8 stars 9 forks source link

Fix incorrect update date when building static site in CI #17

Closed jessarcher closed 1 year ago

jessarcher commented 1 year ago

Thanks for the plugin!

Today, I noticed that the feed currently uses the file's last modification time, which isn't always a reliable indicator. Especially when cloning the repo in a CI environment where the dates will end up as the clone date.

The lastModified method returns a Carbon instance created from the updated_at field on the entry if it exists. Otherwise, it falls back to using the fileLastModified method.

I'm unsure whether this method exists in all versions of Statamic you support, so it may need to be wrapped in a conditional.

martyf commented 1 year ago

Thanks @jessarcher - this exists back in to the v3 territory too. I'll make sure this makes its way in to the current refactor too.

jessarcher commented 1 year ago

Thanks, @martyf!