mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Makes DEFAULT_DATE accept string dates; fixes #1464
This commit is contained in:
parent
2ceeb88c63
commit
3f2d89c9d6
3 changed files with 15 additions and 1 deletions
|
|
@ -607,7 +607,10 @@ def default_metadata(settings=None, process=None):
|
|||
metadata['category'] = value
|
||||
if settings.get('DEFAULT_DATE', None) and \
|
||||
settings['DEFAULT_DATE'] != 'fs':
|
||||
metadata['date'] = SafeDatetime(*settings['DEFAULT_DATE'])
|
||||
if isinstance(settings['DEFAULT_DATE'], six.string_types):
|
||||
metadata['date'] = get_date(settings['DEFAULT_DATE'])
|
||||
else:
|
||||
metadata['date'] = SafeDatetime(*settings['DEFAULT_DATE'])
|
||||
return metadata
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue