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
Use FeedGenerator #2133
Use FeedGenerator #2133
Conversation
I prefer '.xml' to '.atom' for Atom feeds. |
We can’t really change that, and our current Atom implementation is good enough (we want to use feedgenerator for RSS only) |
OK. I have no problem. I will withdraw this PR. |
Wait, no. We could take this from here and make the necessary changes. |
I know that .atom file extension recommended on RFC 4287 https://www.ietf.org/rfc/rfc4287.txt.
at https://support.google.com/merchants/answer/160593?hl=en |
That’s Google Shopping, not Google Search. |
Yes. I know. It's my preference. |
Using .atom will get you the correct Content-Type header from most servers without configuring anything on the server. As a static generator, “without configuring anything on the server” is important. As for “SEO reasons” and client compatibility, the file extension does not matter in the least; only Content-Type – the .atom file extension gets us the correct Content-Type. |
|
||
# The PubSubHubbub URL for feeds. Defaults to None. | ||
# FEED_PUSH = None | ||
|
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.
You’ve also added FEED_DEFAULT_IMAGE
but not added it here nor in nikola.py.
First attempt at building:
|
I must be using the wrong feedgen here, because almost none of the features you’re using exist in the feedgen documentation nor do they exist in the code. |
👎 You’re stripping away much of the support for RFC 5005. 👎 link rel=next-archive, link rel=prev-archive, link rel=current, and the archive element on stale feeds are all missing. link rel=last have been added but should be removed (as we continuously update with new feeds so there is no last feed). I can’t get this to run at the moment, but from looking at the code, the output will be quite different what Nikola produces today. |
nikola/feedutil.py
Outdated
self.site = site | ||
|
||
def atom_renderer(self, fg, output_path, atom_path, xsl_stylesheet_href, | ||
pretty=True): |
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.
This does not need to be an option here nor in rss_renderer(). Always make this pretty, and let users customize the output with filters (like xmlminify
).
I implement 3. Paged Feeds (rel=next|previous|first|last), not 4. Archived Feeds (rel=prev-archive|next-archive|current) on RFC5005. |
7247abc
to
3f31c15
Compare
I rewote this PR and test it myself. |
(Having email trouble so didn’t see your reply earlier.) Nikola has archives and the archives have feeds (extremely well suited as sitemaps). The archive feed extension is thus very much suited for Nikola. |
Sorry for confusing you. |
rel=last is no problem. rel=(first|last|prev|next) are for 3. Paged Feeds in RFC5005. |
@masayuko Sorry about letting your PRs rot ffor so long. I will take a good look at them tomorrow so we can move them forward and merge your work. Thanks for the patience and the effort! |
Unfortunately, this PR has lingered for a very long time, and is probably very outdated (right now, there are 33 merge conflicts), so getting it working with the modern version of Nikola would be a bit of a hassle. I will close this PR and will try to spend some time on re-implementing this feature, partially from scratch, partially using code from this PR. |
I have just adjusted to work with my feedgenerator for PR.
It use my custom feedgenerator that contains some bugfixes and some enhancements. https://github.com/masayuko/python-feedgen
It's a big patch. please check it.