diff --git a/pelicanconf.py b/pelicanconf.py index 4947fd8..85b4263 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -35,8 +35,7 @@ SOCIAL = social.generate() DEFAULT_PAGINATION = False DELETE_OUTPUT_DIRECTORY = True -DEFAULT_DATE_FORMAT = '%c' -DEFAULT_DATE = "fs" + PAGE_PATHS = ["pages"] PAGE_SAVE_AS = "{slug}/index.html" @@ -79,4 +78,8 @@ SITEMAP = { "format": "xml" } +import filters +JINJA_FILTERS = { + "datetime": filters.format_datetime +} # Extra context diff --git a/plugins/filters.py b/plugins/filters.py new file mode 100644 index 0000000..da370a8 --- /dev/null +++ b/plugins/filters.py @@ -0,0 +1,5 @@ +import iso8601 + + +def format_datetime(value): + return iso8601.parse_date(str(value)).strftime("%x") diff --git a/requirements.txt b/requirements.txt index 6edd597..4ddd624 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ colorama==0.3.6 flake8==2.5.0 gitpython==2.0.3 +iso8601==0.1.11 markdown==2.6.6 pelican==3.6.3 diff --git a/theme/templates/projects.html b/theme/templates/projects.html index 30ba848..e12e268 100644 --- a/theme/templates/projects.html +++ b/theme/templates/projects.html @@ -19,7 +19,7 @@

Updated: {{ article.updated }} - Date: {{ article.date }} + Date: {{ article.date|datetime }}

{{ article.content }}