issue a warning in case no timezone is defined

This commit is contained in:
Alexis Metaireau 2011-08-18 13:58:04 +02:00
commit 96b52a2283
2 changed files with 21 additions and 4 deletions

View file

@ -67,13 +67,10 @@ Setting name (default value) what does it do?
on the output path "static". By default, on the output path "static". By default,
pelican will copy the 'images' folder to the pelican will copy the 'images' folder to the
output folder. output folder.
`TIMEZONE` (Optional) The timezone used in the date information, to `TIMEZONE` The timezone used in the date information, to
generate atom and rss feeds. generate atom and rss feeds.
Have a look at `the wikipedia page`_ for more
information
================================================ ===================================================== ================================================ =====================================================
.. _the wikipedia page: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
.. [1] Default is the system locale. Default is to delete the output directory. .. [1] Default is the system locale. Default is to delete the output directory.
Article permalink structure Article permalink structure
@ -104,6 +101,20 @@ Example usage:
* '/%Y/%m/' it will be something like '/2011/07/sample-post.html'. * '/%Y/%m/' it will be something like '/2011/07/sample-post.html'.
* '/%Y/%(category)s/' it will be something like '/2011/life/sample-post.html'. * '/%Y/%(category)s/' it will be something like '/2011/life/sample-post.html'.
Timezone
--------
If no timezone is defined, UTC is assumed. This means that the generated atom
and rss feeds will have wrong date information if your locale is not UTC.
Pelican issues a warning in case this setting is not defined, as it was not
mandatory in old versions.
Have a look at `the wikipedia page`_ to get a list of values to set your
timezone.
.. _the wikipedia page: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Feed settings Feed settings
============= =============

View file

@ -83,5 +83,11 @@ def read_settings(filename):
else: else:
log.warn("LOCALE option doesn't contain a correct value") log.warn("LOCALE option doesn't contain a correct value")
if not 'TIMEZONE' in context:
log.warn("No timezone information specified in the settings. Assuming your "\
"timezone is UTC for feed generation. "\
"Check http://docs.notmyidea.org/alexis/pelican/settings.html#timezone "\
"for more information")
# set the locale # set the locale
return context return context