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

@felixfontein felixfontein commented Dec 10, 2016

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

@felixfontein felixfontein requested a review from Kwpolska Dec 10, 2016
@felixfontein felixfontein mentioned this pull request Dec 10, 2016
Copy link
Member

@Kwpolska Kwpolska left a comment

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

@Kwpolska Kwpolska Dec 11, 2016

May I just put those in my conf.py instead of messing with disabling plugins?

Copy link
Contributor Author

@felixfontein felixfontein Dec 11, 2016

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

@Kwpolska Kwpolska Dec 11, 2016

those two ifs can be merged into one

Copy link
Contributor Author

@felixfontein felixfontein Dec 11, 2016

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

@Kwpolska Kwpolska Dec 11, 2016

if generate_list and taxonomy.show_list_as_index:
elif generate_list:

Copy link
Contributor Author

@felixfontein felixfontein Dec 11, 2016

Done.

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

@felixfontein felixfontein commented Dec 11, 2016

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

@Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented Dec 11, 2016

They could be.

@felixfontein
Copy link
Contributor Author

@felixfontein felixfontein commented Dec 11, 2016

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

@Kwpolska Kwpolska Dec 11, 2016

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

@Kwpolska Kwpolska Dec 11, 2016

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

@felixfontein felixfontein Dec 11, 2016

Better now?

Copy link
Member

@Kwpolska Kwpolska Dec 11, 2016

Much better.

@Kwpolska Kwpolska merged commit 2d1df75 into master Dec 11, 2016
0 of 5 checks passed
@Kwpolska Kwpolska deleted the fixing-2591 branch Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants