aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/task/indexes.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-02-28 08:49:41 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-02-28 08:49:41 -0300
commit0f1e24f7888ba16fe5629c57fd00f0deacb63e5e (patch)
tree7153a3a11b766f375b1d1c0a7adc599e0a9f9c55 /nikola/plugins/task/indexes.py
parent04fc43563d3d5d4218004690b5e14c19c67bdcbc (diff)
parent2828399ba5cbb14502b023d4de1ba02f13dd5055 (diff)
Merge tag 'upstream/6.3.0'
Upstream version 6.3.0
Diffstat (limited to 'nikola/plugins/task/indexes.py')
-rw-r--r--nikola/plugins/task/indexes.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/nikola/plugins/task/indexes.py b/nikola/plugins/task/indexes.py
index 0d20422..3f45161 100644
--- a/nikola/plugins/task/indexes.py
+++ b/nikola/plugins/task/indexes.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -57,6 +57,7 @@ class Indexes(Task):
"hide_untranslated_posts": self.site.config['HIDE_UNTRANSLATED_POSTS'],
"indexes_title": self.site.config['INDEXES_TITLE'],
"indexes_pages": self.site.config['INDEXES_PAGES'],
+ "indexes_pages_main": self.site.config['INDEXES_PAGES_MAIN'],
"blog_title": self.site.config["BLOG_TITLE"],
}
@@ -78,12 +79,18 @@ class Indexes(Task):
for i, post_list in enumerate(lists):
context = {}
indexes_title = kw['indexes_title'] or kw['blog_title']
+ if kw["indexes_pages_main"]:
+ ipages_i = i + 1
+ ipages_msg = "page %d"
+ else:
+ ipages_i = i
+ ipages_msg = "old posts, page %d"
if kw["indexes_pages"]:
- indexes_pages = kw["indexes_pages"] % i
+ indexes_pages = kw["indexes_pages"] % ipages_i
else:
indexes_pages = " (" + \
- kw["messages"][lang]["old posts page %d"] % i + ")"
- if i > 0:
+ kw["messages"][lang][ipages_msg] % ipages_i + ")"
+ if i > 0 or kw["indexes_pages_main"]:
context["title"] = indexes_title + indexes_pages
else:
context["title"] = indexes_title