Skip to content
Permalink
Browse files
Fix #1931
  • Loading branch information
ralsina committed Aug 6, 2015
1 parent 29c2fae commit 3d152c8e3acd1de0973fe71a7f4388fb88acb719
Showing 2 changed files with 7 additions and 4 deletions.
@@ -11,6 +11,7 @@ Features
Bugfixes
--------

* Rebuild archives when post slugs and titles change (Issue #1931)
* Handle special characters in URLs in nikola auto (Issue #1925)
* Avoid Broken Pipe error in nikola auto (Issue #1906)
* "nikola auto" serving implicit index.html with wrong mime type (Issue #1921)
@@ -58,18 +58,20 @@ def _prepare_task(self, kw, name, lang, posts, items, template_name,
# title: the (translated) title for the generated page
# deps_translatable: dependencies (None if not added)
assert posts is not None or items is not None

task_cfg = [copy.copy(kw)]
context = {}
context["lang"] = lang
context["title"] = title
context["permalink"] = self.site.link("archive", name, lang)
context["pagekind"] = ["list", "archive_page"]
if posts is not None:
context["posts"] = posts
n = len(posts)
# Depend on all post metadata because it can be used in templates (Issue #1931)
task_cfg.append(repr(p) for p in posts)
else:
# Depend on the content of items, to rebuild if links change (Issue #1931)
context["items"] = items
n = len(items)
task_cfg.append(items)
task = self.site.generic_post_list_renderer(
lang,
[],
@@ -79,7 +81,7 @@ def _prepare_task(self, kw, name, lang, posts, items, template_name,
context,
)

task_cfg = {1: copy.copy(kw), 2: n}
task_cfg = {i: x for i, x in enumerate(task_cfg)}
if deps_translatable is not None:
task_cfg[3] = deps_translatable
task['uptodate'] = task['uptodate'] + [config_changed(task_cfg, 'nikola.plugins.task.archive')]

0 comments on commit 3d152c8

Please sign in to comment.