mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Allow user to customise the save location of direct template pages from settings.
This commit is contained in:
parent
58d98e918f
commit
cc46ac5d4c
1 changed files with 9 additions and 1 deletions
|
|
@ -182,7 +182,15 @@ class ArticlesGenerator(Generator):
|
||||||
if template in PAGINATED_TEMPLATES:
|
if template in PAGINATED_TEMPLATES:
|
||||||
paginated = {'articles': self.articles, 'dates': self.dates}
|
paginated = {'articles': self.articles, 'dates': self.dates}
|
||||||
|
|
||||||
write('%s.html' % template, self.get_template(template),
|
save_as = self.settings.get("%s_SAVE_AS" % template.upper(), None)
|
||||||
|
if save_as is None:
|
||||||
|
file_name = '%s.html' % template
|
||||||
|
elif save_as:
|
||||||
|
file_name = save_as
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
|
write(file_name, self.get_template(template),
|
||||||
self.context, blog=True, paginated=paginated,
|
self.context, blog=True, paginated=paginated,
|
||||||
page_name=template)
|
page_name=template)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue