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
Fixes #2591 #2594
Fixes #2591 #2594
Conversation
… of index and Atom feed generation.
…indexes plugin independently.
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.
LGTM, and it works. (With only DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED = True
in config, but I’d expect it to work nevertheless)
|
||
# Disable RSS. For a successful disable, we must have both the option | ||
# false and the plugin disabled through the official means. | ||
if 'generate_rss' in self.config['DISABLED_PLUGINS'] and self.config['GENERATE_RSS'] is True: | ||
utils.LOGGER.warn('Please use GENERATE_RSS to disable RSS feed generation, instead of mentioning generate_rss in DISABLED_PLUGINS.') | ||
self.config['GENERATE_RSS'] = False | ||
self.config['DISABLE_INDEXES_PLUGIN_RSS_FEED'] = 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.
May I just put those in my conf.py instead of messing with disabling plugins?
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.
Sure. The messing with disabling plugins is so that backwards compatibility should be kept. I'm adding some more warning messages.
return | ||
# Generate RSS feed | ||
if kw["generate_rss"] and not taxonomy.always_disable_rss: | ||
yield self._generate_classification_page_as_rss(taxonomy, classification, filtered_posts, context['title'], context.get("description"), kw, lang) | ||
if generate_rss: |
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.
those two if
s can be merged into one
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.
Done.
yield self._generate_classification_page_as_index(taxonomy, classification, filtered_posts, context, kw, lang) | ||
else: | ||
yield self._generate_classification_page_as_list(taxonomy, classification, filtered_posts, context, kw, lang) | ||
if generate_list: |
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.
if generate_list and taxonomy.show_list_as_index:
elif generate_list:
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.
Done.
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Should |
They could be. |
I'm done; feel free to merge when you think the latest changes are OK. |
@@ -43,6 +43,9 @@ Features | |||
(Issue #1914) | |||
* Added setting ``SHOW_INDEX_PAGE_NAVIGATION`` which enables a basic | |||
page navigation for indexes. (Issue #2299) | |||
* Added settings ``DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED`` and |
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.
PS. I would personally add new changelog entries at the top, but that’s pretty unimportant.
@@ -1030,6 +1030,14 @@ MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite', 'extra'] | |||
# change it for a FeedBurner feed or something else. | |||
# RSS_LINK = None | |||
|
|||
# The following settings allow to disable specific parts of the indexes plugin |
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.
Wall of mumbo jumbo.
Special settings to disable only parts of the indexes plugin (to allow RSS but no blog indexes, or to allow blog indexes and Atom but no site-wide RSS). Use with care.
Also, those should appear as close to the bottom of the file as possible.
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.
Better now?
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.
Much better.
Adding a lot of special-case logic to allow to fix #2591.