Skip to content

Commit

Permalink
Rename POSTS_SECTION_ARE_INDEXES to POSTS_SECTIONS_ARE_INDEXES
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kwpolska committed Apr 14, 2017
1 parent cc3bafd commit 3e6ee02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -22,6 +22,7 @@ Features
Bugfixes
--------

* Rename ``POSTS_SECTION_ARE_INDEXES`` to ``POSTS_SECTIONS_ARE_INDEXES``
* Make date ranges work in shortcode-based post lists (Issue #2690)
* Read data files only if Nikola configuration exists (Issue #2708)
* Make ``PAGE_INDEX`` work with ``PRETTY_URLS`` (Issue #2705)
Expand Down
9 changes: 7 additions & 2 deletions nikola/nikola.py
Expand Up @@ -548,7 +548,7 @@ def __init__(self, **config):
'POSTS': (("posts/*.txt", "posts", "post.tmpl"),),
'POSTS_SECTIONS': True,
'POSTS_SECTION_COLORS': {},
'POSTS_SECTION_ARE_INDEXES': True,
'POSTS_SECTIONS_ARE_INDEXES': True,
'POSTS_SECTION_DESCRIPTIONS': "",
'POSTS_SECTION_FROM_META': False,
'POSTS_SECTION_NAME': "",
Expand Down Expand Up @@ -941,6 +941,10 @@ def __init__(self, **config):
utils.LOGGER.warn('The STORY_INDEX option is deprecated, use PAGE_INDEX instead.')
self.config['PAGE_INDEX'] = config['STORY_INDEX']

if 'POSTS_SECTION_ARE_INDEXES' in config:
utils.LOGGER.warn('The POSTS_SECTION_ARE_INDEXES option is deprecated, use POSTS_SECTIONS_ARE_INDEXES instead.')
self.config['POSTS_SECTIONS_ARE_INDEXES'] = config['POSTS_SECTION_ARE_INDEXES']

# Configure filters
for actions in self.config['FILTERS'].values():
for i, f in enumerate(actions):
Expand Down Expand Up @@ -1254,7 +1258,8 @@ def _set_global_context_from_config(self):
self._GLOBAL_CONTEXT['hidden_authors'] = self.config.get('HIDDEN_AUTHORS')
self._GLOBAL_CONTEXT['url_replacer'] = self.url_replacer
self._GLOBAL_CONTEXT['posts_sections'] = self.config.get('POSTS_SECTIONS')
self._GLOBAL_CONTEXT['posts_section_are_indexes'] = self.config.get('POSTS_SECTION_ARE_INDEXES')
self._GLOBAL_CONTEXT['posts_section_are_indexes'] = self.config.get('POSTS_SECTIONS_ARE_INDEXES')
self._GLOBAL_CONTEXT['posts_sections_are_indexes'] = self.config.get('POSTS_SECTIONS_ARE_INDEXES')
self._GLOBAL_CONTEXT['posts_section_colors'] = self.config.get('POSTS_SECTION_COLORS')
self._GLOBAL_CONTEXT['posts_section_descriptions'] = self.config.get('POSTS_SECTION_DESCRIPTIONS')
self._GLOBAL_CONTEXT['posts_section_from_meta'] = self.config.get('POSTS_SECTION_FROM_META')
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/sections.py
Expand Up @@ -68,7 +68,7 @@ class ClassifySections(Taxonomy):

def set_site(self, site):
"""Set Nikola site."""
self.show_list_as_index = site.config["POSTS_SECTION_ARE_INDEXES"]
self.show_list_as_index = site.config["POSTS_SECTIONS_ARE_INDEXES"]
self.template_for_single_list = "sectionindex.tmpl" if self.show_list_as_index else "list.tmpl"
self.enable_for_lang = {}
return super(ClassifySections, self).set_site(site)
Expand Down

0 comments on commit 3e6ee02

Please sign in to comment.