1
0
Fork 0
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:
MinchinWeb 2021-06-07 21:46:15 -06:00
commit 845acfe1ac

View file

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