Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 a0f7ecd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
7 changes: 6 additions & 1 deletion nikola/nikola.py
Expand Up @@ -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.

Expand Down
14 changes: 6 additions & 8 deletions nikola/plugins/task/indexes.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit a0f7ecd

Please sign in to comment.