When validating the atom feed produced by the jekyll-feed plugin, I discovered that I had two items in the feed with the same id. It turns out this is because jekyll-feed uses post.id for the unique id, and I have two posts with identical slugs but different dates.
That is, one post is _posts/2021-04-01-something.md and another is _posts/2021-04-05-something.md, but both have a post.id of /something.
What do I need to set to include the date in post.id?
Have you checked the Jekyll feed issues and PRs? Sounds like someone might have had this issue. Or they might explain on their docs.
This isn’t really an issue with jekyll-feed; I’d run into the same problem if I template my own feeds and try to use post.id. The error I’m trying to correct is that post.id, which should be a unique id for a post, is not. This is a problem with Jekyll itself (or my configuration of Jekyll).
I’m looking for help configuring things so that post.id provides a useful value.
Ah, using that permalink I can reproduce the problem you’re seeing with a toy site. Clearly there’s a bug in how page.id is generated when the permalink date isn’t a separate directory. For example, the follow permalink works because of the added slash before :title :
permalink: /:year-:month-:day/:title/
It would be good to get this reported as an issue. At a minimum, Jekyll should produce an error/warning if a particular permalink can’t be used to generate IDs.
For the moment, one work-around might be to use page.url instead of page.id.