Skip to content

Commit

Permalink
Fix #2646 -- make page indexes actually work
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 25, 2017
1 parent 204fd33 commit a8ab66e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.txt
Expand Up @@ -29,6 +29,8 @@ Features
Bugfixes
--------

* Fix crash if ``PAGE_INDEX`` is enabled and make them actually work
(Issue #2646)
* Ignore ``NEW_POST_DATE_PATH`` when creating pages (Issue #2699)
* Ensure ``post.updated`` is timezone-aware (Issue #2698)
* Pass previously missing post object and language to reST compiler
Expand All @@ -44,7 +46,6 @@ Bugfixes
* Fix crash if ``SHOW_INDEX_PAGE_NAVIGATION`` is ``True`` while
``INDEXES_STATIC`` is ``False``. (Issue #2654)
* Make ``NEW_POST_DATE_PATH`` follow ``rrule`` if it exists (issue #2653)
* Fix crash if ``PAGE_INDEX`` is enabled (Issue #2646)

New in v7.8.3
=============
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/page_index.py
Expand Up @@ -94,7 +94,7 @@ def provide_context_and_uptodate(self, dirname, lang, node=None):
}
context = {
"title": self.site.config['BLOG_TITLE'](lang),
"pagekind": ["list", "front_page"] if dirname == '' else ["list"],
"pagekind": ["list", "front_page", "page_index"] if dirname == '' else ["list", "page_index"],
}
kw.update(context)
return context, kw
Expand Down
6 changes: 5 additions & 1 deletion nikola/plugins/task/taxonomies.py
Expand Up @@ -250,7 +250,11 @@ def _generate_classification_page_as_list(self, taxonomy, classification, filter
template_name = taxonomy.template_for_single_list
output_name = os.path.join(self.site.config['OUTPUT_FOLDER'], self.site.path(kind, classification, lang))
context["lang"] = lang
context["posts"] = filtered_posts
# list.tmpl expects a different format than list_post.tmpl (Issue #2701)
if template_name == 'list.tmpl':
context["items"] = [(post.title(), post.permalink(), None) for post in filtered_posts]
else:
context["posts"] = filtered_posts
context["kind"] = kind
if "pagekind" not in context:
context["pagekind"] = ["list", "tag_page"]
Expand Down

0 comments on commit a8ab66e

Please sign in to comment.