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

Fixes #2591 #2594

Merged
merged 8 commits into from Dec 11, 2016
Merged

Fixes #2591 #2594

merged 8 commits into from Dec 11, 2016

Conversation

felixfontein
Copy link
Contributor

Adding a lot of special-case logic to allow to fix #2591.

@felixfontein felixfontein mentioned this pull request Dec 10, 2016
Copy link
Member

@Kwpolska Kwpolska left a 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
Copy link
Member

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?

Copy link
Contributor Author

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those two ifs can be merged into one

Copy link
Contributor Author

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:
Copy link
Member

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:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Kwpolska added a commit to getnikola/irclogs-site that referenced this pull request Dec 11, 2016
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@felixfontein
Copy link
Contributor Author

Should DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED be documented in conf.py? (Or even DISABLE_INDEXES_PLUGIN_RSS_FEED?)

@Kwpolska
Copy link
Member

They could be.

@felixfontein
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better.

@Kwpolska Kwpolska merged commit 2d1df75 into master Dec 11, 2016
@Kwpolska Kwpolska deleted the fixing-2591 branch December 11, 2016 19:13
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.

Can’t disable indexes while keeping RSS on
2 participants