Make archive grouping configurable
The blog that I'm moving to cryogen currently groups the posts by year instead of by year/month. This change makes the grouping configurable while defaulting to the current behavior of year/month grouping on posts.
This commit is contained in:
parent
36656de029
commit
683bcad292
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@
|
||||||
(let [date (if (:date page-meta)
|
(let [date (if (:date page-meta)
|
||||||
(.parse (java.text.SimpleDateFormat. (:post-date-format config)) (:date page-meta))
|
(.parse (java.text.SimpleDateFormat. (:post-date-format config)) (:date page-meta))
|
||||||
(parse-post-date file-name (:post-date-format config)))
|
(parse-post-date file-name (:post-date-format config)))
|
||||||
archive-fmt (java.text.SimpleDateFormat. "yyyy MMMM" (Locale/getDefault))
|
archive-fmt (java.text.SimpleDateFormat. (get config :archive-group-format "yyyy MMMM") (Locale/getDefault))
|
||||||
formatted-group (.format archive-fmt date)]
|
formatted-group (.format archive-fmt date)]
|
||||||
{:date date
|
{:date date
|
||||||
:formatted-archive-group formatted-group
|
:formatted-archive-group formatted-group
|
||||||
|
|
Loading…
Reference in a new issue