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
Customizing main RSS path, as well as Atom and RSS feed extensions #3042
Conversation
nikola/nikola.py
Outdated
@@ -1117,6 +1122,7 @@ def _set_global_context_from_config(self): | |||
self._GLOBAL_CONTEXT['generate_atom'] = self.config.get('GENERATE_ATOM') | |||
self._GLOBAL_CONTEXT['generate_rss'] = self.config.get('GENERATE_RSS') | |||
self._GLOBAL_CONTEXT['rss_path'] = self.config.get('RSS_PATH') | |||
self._GLOBAL_CONTEXT['rss_filename_base'] = self.config.get('RSS_FILENAME_BASE') |
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.
*_extension too. Or otherwise make them cause full rebuilds. (We should have a facility for that, that isn’t global context.)
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.
Fixed. I also added documentation for them.
nikola/conf.py.in
Outdated
@@ -1059,6 +1066,9 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c | |||
# between each other. Old Atom feeds with no changes are marked as archived. | |||
# GENERATE_ATOM = False | |||
|
|||
# Extension for Atom feed files | |||
# FEED_EXTENSION = ".atom" |
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.
ATOM_EXTENSION
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.
Ok.
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.
And now fixed.
… and documenting them.
@@ -233,7 +233,7 @@ def _postprocess_path(self, path, lang, append_index='auto', dest_type='page', p | |||
# Forcing extension for Atom feeds and RSS feeds | |||
force_extension = None | |||
if dest_type == 'feed': | |||
force_extension = '.atom' | |||
force_extension = self.site.config['ATOM_EXTENSION'] | |||
elif dest_type == 'rss': | |||
force_extension = '.xml' |
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.
Shouldn’t this be be RSS_EXTENSION? And what about the ['rss']
on line 243 (gh won’t let me comment there)?
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.
No, since 'feed'
is for Atom feeds ('rss'
is for RSS feeds). But it looks like I forgot to change .xml
two lines below...
And yes, the ['rss']
in line 243 also needs a change.
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.
The comment was (supposed to be) on line 238.
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.
Ah, ok :)
[ci skip]
Looks good. @felixfontein, you may merge if all of this was tested, and if the test suite passes. |
The default settings work fine (i.e. my blogs compile without changes, except updated RSS/Atom feed timestamps). |
A quick test of non-default settings confirms they work. I’ll merge, and if tests fail (they shouldn’t, py3.3 passed), we’ll fix them. |
1 similar comment
A quick test of non-default settings confirms they work. I’ll merge, and if tests fail (they shouldn’t, py3.3 passed), we’ll fix them. |
I was just about to write that the non-default settings seem to work as well :) |
Fixes #3041