diff --git a/docs/settings.rst b/docs/settings.rst index 427795c2..9cae8111 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -142,6 +142,8 @@ Setting name (default value) what does it do? `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. ================================================ ===================================================== +Note: when any of `*_SAVE_AS` is set to False, files will not be created. + Timezone -------- diff --git a/pelican/contents.py b/pelican/contents.py index 593822a9..ba374ba1 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -183,7 +183,12 @@ class URLWrapper(object): def _from_settings(self, key): setting = "%s_%s" % (self.__class__.__name__.upper(), key) - return unicode(self.settings[setting]).format(**self.as_dict()) + value = self.settings[setting] + if not isinstance(value, (str, unicode)): + logger.warning(u'%s is set to %s' % (setting, value)) + return value + else: + return unicode(value).format(**self.as_dict()) url = property(functools.partial(_from_settings, key='URL')) save_as = property(functools.partial(_from_settings, key='SAVE_AS')) diff --git a/pelican/writers.py b/pelican/writers.py index 4dd04a2a..593879e2 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -99,6 +99,12 @@ class Writer(object): :param **kwargs: additional variables to pass to the templates """ + if name is False: + return + elif not name: + # other stuff, just return for now + return + def _write_file(template, localcontext, output_path, name): """Render the template write the file.""" old_locale = locale.setlocale(locale.LC_ALL)