Fix: " et '

This commit is contained in:
Bertrand Benjamin 2023-04-14 13:57:39 +02:00
parent 9a2d687434
commit dab40dddd0

View File

@ -5,16 +5,18 @@ If "modified" date/time is not defined in article metadata, fall back to the "cr
from pelican import signals from pelican import signals
from pelican.contents import Content, Article from pelican.contents import Content, Article
def add_modified(content): def add_modified(content):
if not isinstance(content, Article): if not isinstance(content, Article):
return return
if not content.settings.get('ALWAYS_MODIFIED', False): if not content.settings.get("ALWAYS_MODIFIED", False):
return return
if hasattr(content, 'date') and not hasattr(content, 'modified'): if hasattr(content, "date") and not hasattr(content, "modified"):
content.modified = content.date content.modified = content.date
content.locale_modified = content.locale_date content.locale_modified = content.locale_date
def register(): def register():
signals.content_object_init.connect(add_modified) signals.content_object_init.connect(add_modified)