diff options
| author | W. Trevor King <wking@tremily.us> | 2013-06-11 21:40:13 -0400 |
|---|---|---|
| committer | W. Trevor King <wking@tremily.us> | 2013-06-11 22:53:21 -0400 |
| commit | 228fc82fc9c09493748e7fdf949fc1942cad0a7e (patch) | |
| tree | 0ec1c6ee71deb41b7d7429539e406fbde8a478f2 /docs | |
| parent | 1fcf4a6550d6ef8ffb3d8c24376cae63f939f5c9 (diff) | |
| download | pelican-228fc82fc9c09493748e7fdf949fc1942cad0a7e.tar.gz | |
utils: Add some ISO 8601 forms to get_date()
Support the forms listed by the W3C [1]. I also removed the
'%Y-%d-%m' form, which can be confused with the '%Y-%m-%d' ISO form.
The new ISO forms can use 'Z' to designate UTC or '[+-]HHMM' to
specify offsets from UTC. Other time zone designators are not
supported.
The '%z' directive has only been supported since Python 3.2 [2], so if
you're running Pelican on Python 2.7, you're stuck with 'Z' for UTC.
Conveniently, we get ValueErrors for both invalid directives and
data/format missmatches, so we don't need special handling for the 2.7
case inside get_date().
[1]: http://www.w3.org/TR/NOTE-datetime
[2]: http://bugs.python.org/issue6641
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/getting_started.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/getting_started.rst b/docs/getting_started.rst index b41f8c18..7cd3267e 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -286,7 +286,10 @@ by the directory in which the file resides. For example, a file located at ``python/foobar/myfoobar.rst`` will have a category of ``foobar``. If you would like to organize your files in other ways where the name of the subfolder would not be a good category name, you can set the setting ``USE_FOLDER_AS_CATEGORY`` -to ``False``. +to ``False``. When parsing dates given in the page metadata, Pelican supports +the W3C's `suggested subset ISO 8601`__. + +__ `W3C ISO 8601`_ If you do not explicitly specify summary metadata for a given post, the ``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from the @@ -478,3 +481,4 @@ metadata. That article will then be output to the ``drafts`` folder and not listed on the index page nor on any category page. .. _virtualenv: http://www.virtualenv.org/ +.. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime |
