Optional :date key can be provided in metadata

This commit is contained in:
Brendon Walsh 2015-07-29 11:50:00 -04:00
parent 85ea98f0ff
commit e710f08679

View file

@ -102,7 +102,11 @@
(let [{:keys [file-name page-meta content]} (page-content page config markup)]
(merge
(merge-meta-and-content file-name page-meta content)
(let [date (parse-post-date file-name (:post-date-format config))
(let [date (if (:date page-meta)
(.parse (java.text.SimpleDateFormat.
(:post-date-format config))
(:date page-meta))
(parse-post-date file-name (:post-date-format config)))
archive-fmt (java.text.SimpleDateFormat. "yyyy MMMM" (java.util.Locale. "en"))
formatted-group (.format archive-fmt date)]
{:date date