Fix CLEAN_URLS and place articles in <slug>/index.html

This commit is contained in:
Kyle Fuller 2011-12-13 23:24:59 +00:00
commit 256b92e5c4

View file

@ -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