Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Address review comments
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 13, 2018
1 parent faafa06 commit 5525d73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions nikola/nikola.py
Expand Up @@ -2484,6 +2484,9 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont
as the ones for page_link.
additional_dependencies: a list of dependencies which will be added
to task['uptodate']
Note: if context['featured'] is present, it must be a list of posts,
whose dependencies will be taken added to task['uptodate'].
"""
# Update kw
kw = kw.copy()
Expand Down
4 changes: 3 additions & 1 deletion nikola/plugins/task/indexes.py
Expand Up @@ -112,12 +112,14 @@ def get_path(self, classification, lang, dest_type='page'):
def provide_context_and_uptodate(self, classification, lang, node=None):
"""Provide data for the context and the uptodate list for the list of the given classifiation."""
kw = {
"show_untranslated_posts": self.site.config["SHOW_UNTRANSLATED_POSTS"],
}
context = {
"title": self.site.config["INDEXES_TITLE"](lang) or self.site.config["BLOG_TITLE"](lang),
"description": self.site.config["BLOG_DESCRIPTION"](lang),
"pagekind": ["main_index", "index"],
"featured": [p for p in self.site.posts if p.post_status == 'featured' and lang in p.translated_to],
"featured": [p for p in self.site.posts if p.post_status == 'featured'
and (lang in p.translated_to or kw["show_untranslated_posts"])],
}
kw.update(context)
return context, kw
Expand Down

0 comments on commit 5525d73

Please sign in to comment.