bnomei / kirby3-feed

Generate a RSS/JSON-Feed and Sitemap from a Pages-Collection.
https://forum.getkirby.com/t/kirby3-feed-rss-json-sitemap/23574
MIT License
64 stars 8 forks source link

Last Modified Date #42

Closed clivewalker closed 2 years ago

clivewalker commented 2 years ago

The Last Modified date in my sitemap.xml appears to be the same for all pages. The pages were created on different dates/times. Do I need to do something else here to output the accurate Last Modified dates for each page?

Thanks.

texnixe commented 2 years ago

Having the same issue. That is because the plugin uses the date field or modified date of the first page in the list for all items.

texnixe commented 2 years ago

@clivewalker You can overwrite the snippet in /site/snippets/feed/sitemap.php and replace

<lastmod><?= $modified ?></lastmod>

with

<lastmod><?= date('c', $item->modified()) ?></lastmod>

(Or if you are using a field, with $item->datefieldname()->toDate('c').

clivewalker commented 2 years ago

OK, that's fixed it. Thank you.

bnomei commented 2 years ago

thanks @clivewalker @texnixe for spotting this issue and providing a fix. sorry it took me so long to create a new release. 🙇