Skip to content
Permalink
Browse files
Fix a nasty index rebuild bug.
Seemingly caused by manipulating kw[] on the fly, and not translating some
variables properly.

(cc @Aeyoun?)

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Feb 11, 2016
1 parent 910a52e commit a0f7ecd1dd5728780095ee3df8b4c10640acc21e
Showing with 12 additions and 9 deletions.
  1. +6 −1 nikola/nikola.py
  2. +6 −8 nikola/plugins/task/indexes.py
@@ -581,7 +581,12 @@ def __init__(self, **config):
'body_end',
'extra_head_data',
'date_format',
'js_date_format',)
'js_date_format',
'posts_section_colors',
'posts_section_descriptions',
'posts_section_name',
'posts_section_title',
)
# WARNING: navigation_links SHOULD NOT be added to the list above.
# Themes ask for [lang] there and we should provide it.

@@ -110,8 +110,6 @@ def page_path(i, displayed_i, num_pages, force_addition, extension=None):
yield self.site.generic_index_renderer(lang, filtered_posts, indexes_title, template_name, context, kw, 'render_indexes', page_link, page_path)

if self.site.config['POSTS_SECTIONS']:

kw["posts_section_are_indexes"] = self.site.config['POSTS_SECTION_ARE_INDEXES']
index_len = len(kw['index_file'])

groups = defaultdict(list)
@@ -147,14 +145,14 @@ def cat_path(i, displayed_i, num_pages, force_addition, extension=None):

if kw["posts_section_are_indexes"]:
context["pagekind"].append("index")
kw["posts_section_title"] = self.site.config['POSTS_SECTION_TITLE'](lang)
posts_section_title = self.site.config['POSTS_SECTION_TITLE'](lang)

section_title = None
if type(kw["posts_section_title"]) is dict:
if section_slug in kw["posts_section_title"]:
section_title = kw["posts_section_title"][section_slug]
elif type(kw["posts_section_title"]) is str:
section_title = kw["posts_section_title"]
if type(posts_section_title) is dict:
if section_slug in posts_section_title:
section_title = posts_section_title[section_slug]
elif type(posts_section_title) is str:
section_title = posts_section_title
if not section_title:
section_title = post_list[0].section_name(lang)
section_title = section_title.format(name=post_list[0].section_name(lang))

0 comments on commit a0f7ecd

Please sign in to comment.