Skip to content

Commit

Permalink
pagekind style fixes
Browse files Browse the repository at this point in the history
* flake8
* rename `pages_page` → `story_page`
* I don’t really like the word `pagekind`, btw

cc @Aeyoun

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 12, 2015
1 parent 1526c8d commit ad73bae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions nikola/nikola.py
Expand Up @@ -1536,7 +1536,7 @@ def generic_page_renderer(self, lang, post, filters, context=None):
context['title'] = post.title(lang)
context['description'] = post.description(lang)
context['permalink'] = post.permalink(lang)
if not 'pagekind' in context:
if 'pagekind' not in context:
context['pagekind'] = ['generic_page']
if post.use_in_feeds:
context['enable_comments'] = True
Expand Down Expand Up @@ -1825,7 +1825,7 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont
num_pages = len(lists)
for i, post_list in enumerate(lists):
context = context_source.copy()
if not 'pagekind' in context:
if 'pagekind' not in context:
context['pagekind'] = ['index']
ipages_i = utils.get_displayed_page_number(i, num_pages, self)
if kw["indexes_pages"]:
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/indexes.py
Expand Up @@ -116,7 +116,7 @@ def page_path(i, displayed_i, num_pages, force_addition, extension=None):
link = link[:-index_len]
context["permalink"] = link
context["pagekind"] = ["list"]
if dirnme == "/":
if dirname == "/":
context["pagekind"].append("front_page")

for post in post_list:
Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/task/pages.py
Expand Up @@ -50,9 +50,9 @@ def gen_tasks(self):
if not kw["show_untranslated_posts"] and not post.is_translation_available(lang):
continue
if post.is_post:
context = {'pagekind': ['post_page',]}
context = {'pagekind': ['post_page']}
else:
context = {'pagekind': ['pages_page',]}
context = {'pagekind': ['story_page']}
for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'nikola.plugins.task.pages')]
task['basename'] = self.name
Expand Down

0 comments on commit ad73bae

Please sign in to comment.