mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #194 from kylef/clean_urls
Fix CLEAN_URLS and place articles in <slug>/index.html
This commit is contained in:
commit
522ac12dc9
1 changed files with 10 additions and 2 deletions
|
|
@ -55,10 +55,18 @@ class Page(object):
|
||||||
# create save_as from the slug (+lang)
|
# create save_as from the slug (+lang)
|
||||||
if not hasattr(self, 'save_as') and hasattr(self, 'slug'):
|
if not hasattr(self, 'save_as') and hasattr(self, 'slug'):
|
||||||
if self.in_default_lang:
|
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
|
clean_url = '%s/' % self.slug
|
||||||
else:
|
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)
|
clean_url = '%s-%s/' % (self.slug, self.lang)
|
||||||
|
|
||||||
# change the save_as regarding the settings
|
# change the save_as regarding the settings
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue