Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3e6ee02

Browse files
committedApr 14, 2017
Rename POSTS_SECTION_ARE_INDEXES to POSTS_SECTIONS_ARE_INDEXES
This fixes a grammar mistake in the setting name. Note that conf.py contained the “new” name all along, so some people might have thought this setting was broken. (It certainly was unused or we would’ve heard about that.) Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent cc3bafd commit 3e6ee02

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
 

‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Features
2222
Bugfixes
2323
--------
2424

25+
* Rename ``POSTS_SECTION_ARE_INDEXES`` to ``POSTS_SECTIONS_ARE_INDEXES``
2526
* Make date ranges work in shortcode-based post lists (Issue #2690)
2627
* Read data files only if Nikola configuration exists (Issue #2708)
2728
* Make ``PAGE_INDEX`` work with ``PRETTY_URLS`` (Issue #2705)

‎nikola/nikola.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def __init__(self, **config):
548548
'POSTS': (("posts/*.txt", "posts", "post.tmpl"),),
549549
'POSTS_SECTIONS': True,
550550
'POSTS_SECTION_COLORS': {},
551-
'POSTS_SECTION_ARE_INDEXES': True,
551+
'POSTS_SECTIONS_ARE_INDEXES': True,
552552
'POSTS_SECTION_DESCRIPTIONS': "",
553553
'POSTS_SECTION_FROM_META': False,
554554
'POSTS_SECTION_NAME': "",
@@ -941,6 +941,10 @@ def __init__(self, **config):
941941
utils.LOGGER.warn('The STORY_INDEX option is deprecated, use PAGE_INDEX instead.')
942942
self.config['PAGE_INDEX'] = config['STORY_INDEX']
943943

944+
if 'POSTS_SECTION_ARE_INDEXES' in config:
945+
utils.LOGGER.warn('The POSTS_SECTION_ARE_INDEXES option is deprecated, use POSTS_SECTIONS_ARE_INDEXES instead.')
946+
self.config['POSTS_SECTIONS_ARE_INDEXES'] = config['POSTS_SECTION_ARE_INDEXES']
947+
944948
# Configure filters
945949
for actions in self.config['FILTERS'].values():
946950
for i, f in enumerate(actions):
@@ -1254,7 +1258,8 @@ def _set_global_context_from_config(self):
12541258
self._GLOBAL_CONTEXT['hidden_authors'] = self.config.get('HIDDEN_AUTHORS')
12551259
self._GLOBAL_CONTEXT['url_replacer'] = self.url_replacer
12561260
self._GLOBAL_CONTEXT['posts_sections'] = self.config.get('POSTS_SECTIONS')
1257-
self._GLOBAL_CONTEXT['posts_section_are_indexes'] = self.config.get('POSTS_SECTION_ARE_INDEXES')
1261+
self._GLOBAL_CONTEXT['posts_section_are_indexes'] = self.config.get('POSTS_SECTIONS_ARE_INDEXES')
1262+
self._GLOBAL_CONTEXT['posts_sections_are_indexes'] = self.config.get('POSTS_SECTIONS_ARE_INDEXES')
12581263
self._GLOBAL_CONTEXT['posts_section_colors'] = self.config.get('POSTS_SECTION_COLORS')
12591264
self._GLOBAL_CONTEXT['posts_section_descriptions'] = self.config.get('POSTS_SECTION_DESCRIPTIONS')
12601265
self._GLOBAL_CONTEXT['posts_section_from_meta'] = self.config.get('POSTS_SECTION_FROM_META')

‎nikola/plugins/task/sections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ClassifySections(Taxonomy):
6868

6969
def set_site(self, site):
7070
"""Set Nikola site."""
71-
self.show_list_as_index = site.config["POSTS_SECTION_ARE_INDEXES"]
71+
self.show_list_as_index = site.config["POSTS_SECTIONS_ARE_INDEXES"]
7272
self.template_for_single_list = "sectionindex.tmpl" if self.show_list_as_index else "list.tmpl"
7373
self.enable_for_lang = {}
7474
return super(ClassifySections, self).set_site(site)

0 commit comments

Comments
 (0)
Please sign in to comment.