Skip to content

Commit 94d581d

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 16c1ef5 commit 94d581d

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed
 

‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Features
2424
Bugfixes
2525
--------
2626

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

‎docs/template-variables.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ Name Type Descript
8080
``navigation_links`` TranslatableSetting ``NAVIGATION_LINKS`` setting
8181
``needs_ipython_css`` bool whether or not IPython CSS is needed by this site
8282
``posts_sections`` bool ``POSTS_SECTIONS`` setting
83-
``posts_section_are_indexes`` bool ``POSTS_SECTION_ARE_INDEXES`` setting
83+
``posts_section_are_indexes`` bool ``POSTS_SECTIONS_ARE_INDEXES`` setting
84+
``posts_sections_are_indexes`` bool ``POSTS_SECTIONS_ARE_INDEXES`` setting
8485
``posts_section_colors`` TranslatableSetting ``POSTS_SECTION_COLORS`` setting
8586
``posts_section_descriptions`` Tss ``POSTS_SECTION_DESCRIPTIONS`` setting
8687
``posts_section_from_meta`` bool ``POSTS_SECTION_FROM_META`` setting

‎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.