aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/task/indexes.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-10-21 10:33:15 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-10-21 10:33:15 -0300
commit5ec02211214350ee558fd9f6bb052264fd24f75e (patch)
treeb61e8c61a95d18a91d053e71dcbd7b30e47552a1 /nikola/plugins/task/indexes.py
parent58c4878526dec5510f23c812274686787d8724ba (diff)
Imported Upstream version 7.1.0upstream/7.1.0
Diffstat (limited to 'nikola/plugins/task/indexes.py')
-rw-r--r--nikola/plugins/task/indexes.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/nikola/plugins/task/indexes.py b/nikola/plugins/task/indexes.py
index 386cc18..0a2cd02 100644
--- a/nikola/plugins/task/indexes.py
+++ b/nikola/plugins/task/indexes.py
@@ -147,20 +147,29 @@ class Indexes(Task):
groups[dirname].append(p)
for dirname, post_list in groups.items():
context = {}
- context["items"] = [
- (post.title(lang), post.permalink(lang))
- for post in post_list
- ]
+ context["items"] = []
+ should_render = True
output_name = os.path.join(kw['output_folder'], dirname, kw['index_file'])
- task = self.site.generic_post_list_renderer(lang, post_list,
- output_name,
- template_name,
- kw['filters'],
- context)
- task_cfg = {1: task['uptodate'][0].config, 2: kw}
- task['uptodate'] = [config_changed(task_cfg)]
- task['basename'] = self.name
- yield task
+ short_destination = os.path.join(dirname, kw['index_file'])
+ for post in post_list:
+ # If there is an index.html pending to be created from
+ # a story, do not generate the STORY_INDEX
+ if post.destination_path(lang) == short_destination:
+ should_render = False
+ else:
+ context["items"].append((post.title(lang),
+ post.permalink(lang)))
+
+ if should_render:
+ task = self.site.generic_post_list_renderer(lang, post_list,
+ output_name,
+ template_name,
+ kw['filters'],
+ context)
+ task_cfg = {1: task['uptodate'][0].config, 2: kw}
+ task['uptodate'] = [config_changed(task_cfg)]
+ task['basename'] = self.name
+ yield task
def index_path(self, name, lang):
if name not in [None, 0]: