From 256b92e5c49e51a41ca3fafd8f8654ef8651e922 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Tue, 13 Dec 2011 23:24:59 +0000 Subject: [PATCH] Fix CLEAN_URLS and place articles in /index.html --- pelican/contents.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 9c2327d4..d61d3710 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -55,10 +55,18 @@ class Page(object): # create save_as from the slug (+lang) if not hasattr(self, 'save_as') and hasattr(self, 'slug'): if self.in_default_lang: - self.save_as = '%s.html' % self.slug + if settings.get('CLEAN_URLS', False): + self.save_as = '%s/index.html' % self.slug + else: + self.save_as = '%s.html' % self.slug + clean_url = '%s/' % self.slug else: - self.save_as = '%s-%s.html' % (self.slug, self.lang) + if settings.get('CLEAN_URLS', False): + self.save_as = '%s-%s/index.html' % (self.slug, self.lang) + else: + self.save_as = '%s-%s.html' % (self.slug, self.lang) + clean_url = '%s-%s/' % (self.slug, self.lang) # change the save_as regarding the settings