Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post.id is not unique -- should we use post.url instead? #340

Open
larsks opened this issue Apr 9, 2021 · 6 comments
Open

post.id is not unique -- should we use post.url instead? #340

larsks opened this issue Apr 9, 2021 · 6 comments
Labels

Comments

@larsks
Copy link

larsks commented Apr 9, 2021

I'm running jekyll-feed (0.15.1) with Jekyll version 3.9.0. The feed generated by jekyll-feed uses the value of post.id to create the unique id for each post. Unfortunately, this value appears to only consider the title slug, meaning that two different posts named like this:

  • _posts/2021-04-02-something.md
  • _posts/2021-04-03-something.md

Will both have post.id set to <baseurl>/something. This causes problems with feed readers, since they use the <id> element to differentiate between posts.

It's not clear to me if this is a Jekyll issue (why isn't post.id unique) or a jekyll-feed issue (just use post.url instead of post.id for the unique id).

@jekyllbot jekyllbot added the stale label Jun 9, 2021
@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@ashmaroli
Copy link
Member

@larsks With default configuration, your posts' ids would have been /2021/04/02/something and /2021/04/03/something.
Are you using a custom permalink template for your posts?

@jekyllbot jekyllbot removed the stale label Aug 7, 2021
@bencomp
Copy link

bencomp commented Aug 13, 2021

I just noticed this issue too, in a second feed for an events collection. There is no custom permalink set for this collection as far as I can tell, but the URLs for pages look like /events/2021-09-15-meetup.html and the <id> in the feed becomes <id>https://nl-rse.org/events/meetup</id>. For the main feed that has the blog posts, all is as @ashmaroli describes.

@ashmaroli
Copy link
Member

@bencomp Will you be able to set up a minimal repository that showcases the discrepancy reported?
Thanks in advance.

@bencomp
Copy link

bencomp commented Aug 16, 2021

I think the issue is with Jekyll core, which for non-post collections does not make the date in the filename part of the URL.
id is defined as the base URL + slug:

https://github.com/jekyll/jekyll/blob/6855200ebda6c0e33f487da69e4e02ec3d8286b7/lib/jekyll/document.rb#L395-L397

slug is extracted from the filename using a regular expression that matches date parts as well:

https://github.com/jekyll/jekyll/blob/6855200ebda6c0e33f487da69e4e02ec3d8286b7/lib/jekyll/document.rb#L513

Maybe this can be solved by adding permalink templates for collections. Let me try later this week.

@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@parkr parkr reopened this Dec 16, 2021
@parkr parkr added pinned and removed stale labels Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants