mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Added setting option RELATIVE_URLS to change default behaviour of file writer.
This commit is contained in:
parent
52459768f2
commit
c64ccc4fcd
2 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from operator import attrgetter
|
||||
from itertools import chain
|
||||
from functools import partial
|
||||
from datetime import datetime
|
||||
from collections import defaultdict
|
||||
import os
|
||||
|
|
@ -128,7 +129,10 @@ class ArticlesGenerator(Generator):
|
|||
TODO: change the name"""
|
||||
|
||||
templates = self.get_templates()
|
||||
write = writer.write_file
|
||||
write = partial(
|
||||
writer.write_file,
|
||||
relative_urls = self.settings.get('RELATIVE_URLS')
|
||||
)
|
||||
for template in _DIRECT_TEMPLATES:
|
||||
write('%s.html' % template, templates[template], self.context,
|
||||
blog=True)
|
||||
|
|
@ -223,7 +227,8 @@ class PagesGenerator(Generator):
|
|||
templates = self.get_templates()
|
||||
for page in chain(self.translations, self.pages):
|
||||
writer.write_file('pages/%s' % page.save_as, templates['page'],
|
||||
self.context, page=page)
|
||||
self.context, page=page,
|
||||
relative_urls = self.settings.get('RELATIVE_URLS'))
|
||||
|
||||
|
||||
class StaticGenerator(Generator):
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ _DEFAULT_CONFIG = {'PATH': None,
|
|||
'REVERSE_ARCHIVE_ORDER': False,
|
||||
'KEEP_OUTPUT_DIRECTORY': False,
|
||||
'CLEAN_URLS': False, # use /blah/ instead /blah.html in urls
|
||||
'RELATIVE_URLS': True,
|
||||
'DEFAULT_LANG': 'en',
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue