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

Initial JSON Feed implementation #229

Merged
merged 11 commits into from May 22, 2017
Merged

Initial JSON Feed implementation #229

merged 11 commits into from May 22, 2017

Conversation

Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented May 21, 2017

Fixes getnikola/nikola#2779.

An experimental implementation of the JSON Feed specification (version 1).

Currently only supports main blog RSS (/feed.json). Other items are not supported, but are planned for the future.

Comments, ideas, insights welcome. (I had to make some uglier architectural decisions, including duplicating code, because this is not in Core.)

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@felixfontein
Copy link
Contributor

BTW, how about a bit of infrastructure in Nikola core which allows to add new feed types (or remove existing ones by disabling corresponding plugins)? Currently, RSS and Atom are kind of hard-coded and it is hard to change their behavior.

Also, Atom and RSS behave very differently: Atom is like another representation of the accompanying HTML page, while RSS is what I traditionally knew as a feed. I guess the infrastructure would have to support both modes. Or are there even more modes than these two to consider?

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska
Copy link
Member Author

How many feed types are there, really? I don’t think we need to bother. This plugin works pretty well without any core changes, the only things I can’t handle very nicely from here would be galleries (but it’s doable with some copy-paste, I’ll see if it’s doable later).

@felixfontein There is an issue with tags: site.posts_per_classification does not have untranslated tags. Those tags do get RSS feeds and indexes, should I use something else?

@felixfontein
Copy link
Contributor

This also happens for categories, and it is some kind of left-over from the past / something for compatibility to the old version.

There's some extra code in taxonomies.py which collects tag and category names from all languages when also_create_classifications_from_other_languages is True, which happens precisely for the tag and category taxonomies. I guess you have to copy that behavior.

(I'd personally would be happy if we'd remove this behavior from the taxonomies at some point in the future. I don't see any reason why these should be generated in the first place.)

@felixfontein
Copy link
Contributor

About feed types: no idea. I'm happy with RSS and Atom (though I still don't know what Atom is for anyway). It would just also clean up the RSS and Atom code a bit, currently explicit RSS and Atom handling is all over the place.

(Adds support for also_create_classifications_from_other_languages)
h/t @felixfontein

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska
Copy link
Member Author

This is pretty done now, there seem to be some dependency problems (probably caused by template_handlers). I’ll look at it tomorrow.

@felixfontein make an issue in the main repo for also_create… and other things in Taxonomies that should be deprecated/changed in v8.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska Kwpolska merged commit 953e196 into master May 22, 2017
@Kwpolska Kwpolska deleted the jsonfeed branch May 22, 2017 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants