Skip to content

Commit

Permalink
Merge pull request #2719 from getnikola/posts_sections_are_indexes
Browse files Browse the repository at this point in the history
Rename POSTS_SECTION_ARE_INDEXES to POSTS_SECTIONS_ARE_INDEXES
  • Loading branch information
Kwpolska committed Apr 14, 2017
2 parents 321914b + 94d581d commit 45558aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -24,6 +24,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
3 changes: 2 additions & 1 deletion docs/template-variables.rst
Expand Up @@ -80,7 +80,8 @@ Name Type Descript
``navigation_links`` TranslatableSetting ``NAVIGATION_LINKS`` setting
``needs_ipython_css`` bool whether or not IPython CSS is needed by this site
``posts_sections`` bool ``POSTS_SECTIONS`` setting
``posts_section_are_indexes`` bool ``POSTS_SECTION_ARE_INDEXES`` setting
``posts_section_are_indexes`` bool ``POSTS_SECTIONS_ARE_INDEXES`` setting
``posts_sections_are_indexes`` bool ``POSTS_SECTIONS_ARE_INDEXES`` setting
``posts_section_colors`` TranslatableSetting ``POSTS_SECTION_COLORS`` setting
``posts_section_descriptions`` Tss ``POSTS_SECTION_DESCRIPTIONS`` setting
``posts_section_from_meta`` bool ``POSTS_SECTION_FROM_META`` setting
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 45558aa

Please sign in to comment.