Skip to content

Commit ad73bae

Browse files
committedJul 12, 2015
pagekind style fixes
* 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>
1 parent 1526c8d commit ad73bae

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

Diff for: ‎nikola/nikola.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ def generic_page_renderer(self, lang, post, filters, context=None):
15361536
context['title'] = post.title(lang)
15371537
context['description'] = post.description(lang)
15381538
context['permalink'] = post.permalink(lang)
1539-
if not 'pagekind' in context:
1539+
if 'pagekind' not in context:
15401540
context['pagekind'] = ['generic_page']
15411541
if post.use_in_feeds:
15421542
context['enable_comments'] = True
@@ -1825,7 +1825,7 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont
18251825
num_pages = len(lists)
18261826
for i, post_list in enumerate(lists):
18271827
context = context_source.copy()
1828-
if not 'pagekind' in context:
1828+
if 'pagekind' not in context:
18291829
context['pagekind'] = ['index']
18301830
ipages_i = utils.get_displayed_page_number(i, num_pages, self)
18311831
if kw["indexes_pages"]:

Diff for: ‎nikola/plugins/task/indexes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def page_path(i, displayed_i, num_pages, force_addition, extension=None):
116116
link = link[:-index_len]
117117
context["permalink"] = link
118118
context["pagekind"] = ["list"]
119-
if dirnme == "/":
119+
if dirname == "/":
120120
context["pagekind"].append("front_page")
121121

122122
for post in post_list:

Diff for: ‎nikola/plugins/task/pages.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def gen_tasks(self):
5050
if not kw["show_untranslated_posts"] and not post.is_translation_available(lang):
5151
continue
5252
if post.is_post:
53-
context = {'pagekind': ['post_page',]}
53+
context = {'pagekind': ['post_page']}
5454
else:
55-
context = {'pagekind': ['pages_page',]}
55+
context = {'pagekind': ['story_page']}
5656
for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
5757
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'nikola.plugins.task.pages')]
5858
task['basename'] = self.name

0 commit comments

Comments
 (0)
Please sign in to comment.