-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Simplify feed ID generation and support URL fragments #1306
Conversation
Hi @Scheirle. Thanks for the contribution. I hadn't realized that the That said, my original implementation produces the precise tag I'm looking for:
... whereas the implementation in this pull request produces:
What is the benefit of prepending and appending a slash at the beginning and end of the URL? If the extra slashes were kept as implemented in this pull request, at the very least we'd have to ensure the double-slash behavior showcased above is somehow avoided. |
Technically there is no benefit by doing so, but following this guideline to create tag uris you only insert the date between the domain name an the path (Except from the protocol which gets removed.). Therefore all characters of the actual url are still there (especially the first slash). The slash at the end comes from the lazy implementation of To prevent double slashes we could strip the last characters if they are slashes: ...
unique_id=get_tag_uri(link.rstrip('/'), item.date),
... But keep in mind if the url doesn't have a slash at the end. E.g In my opinion it is not worth it to strip the slashes manually, since the only purpose of the id is to be unique which is the case with or without double slashes. And since one reason for this pull request is to make the id generation as simple as possible I think we should rely on the But if you want me to update the pull request with the above modification I am pleased to do so. |
@justinmayer any thoughts on this? The pelican comment system depends on the support of url fragments, so it can generates valid feed entry ids. |
@Scheirle: What do you think about modifying Please accept my sincere apologies for the absurdly long delay in responding! |
Yeah that is probably the right way to do it. |
780c93d
to
09cabd1
Compare
Corresponding feedgenerator pull request merged! |
Checked off another box in the above list. 🎊 |
Finally this can be merged!
It would save work (Avoid further merge conflicts) if this gets merged before #1989 resolves it merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, Bernhard!
I have tested this, and it behaves as expected. Any other @getpelican/reviewers care to review this before it is merged? |
It gives back full content in RSS feeds. This was changed to summary-only in [1]. The option was added in [2]. Both between 3.6.3 and 3.7. The only changes in feeds between 3.6.3 (with hardcoded html5 as markdown's output format) and 3.7 are the following: * Atom feeds: full content of article moved from <summary/> to </content> and <summary/> becomes really summary. * Atom/RSS feeds: strings in <id/> / <guid/> slightly changed by [3]. The first should be good, the second can cause some RSS/Atom readers to find fake new items when the website will updated. [1]: getpelican/pelican#1989 [2]: getpelican/pelican#2051 [3]: getpelican/pelican#1306
This allows to smoothly move from old IDs format to new one implemented in [1]. [1]: getpelican/pelican#1306
Note that this causes a regression - different ids will be generated if you upgrade pelican! |
This means all your items will get republished wherever they are consumed, an undesirable consequence (annoying feed spam). |
Changes:
/
more, one at the beginning of the path section and one at the end.http://test.de/index.html#fragment
gets now the idtag:test.de,{date}:/index.html/fragment
instead oftag:test.de,{date}:index.html
)TODO:
get_tag_uri
: Changes get_tag_uri so that the '/' before a fragment gets only added if there is a fragment feedgenerator#4