forked from github/pelican
Allow easy subclassing of Writer
When you write a custom Writer, it gets called with `settings=None`. If you writer is simply a subclass of the built-in Writer, Pelican will through the error `CRITICAL: 'RELATIVE_URLS'`. The source of the error is from `Pelican._get_writer()` in `__init__.py`.
This commit is contained in:
parent
c041bf2192
commit
845acfe1ac
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ class Writer:
|
|||
self._overridden_files = set()
|
||||
|
||||
# See Content._link_replacer for details
|
||||
if self.settings['RELATIVE_URLS']:
|
||||
if "RELATIVE_URLS" in self.settings and self.settings['RELATIVE_URLS']:
|
||||
self.urljoiner = posix_join
|
||||
else:
|
||||
self.urljoiner = lambda base, url: urljoin(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue