From 683bcad292e64f4fd03b118a47ff1f27ce13730f Mon Sep 17 00:00:00 2001 From: Dan Hable Date: Tue, 8 Mar 2016 20:22:20 -0600 Subject: [PATCH] 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. --- src/cryogen_core/compiler.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryogen_core/compiler.clj b/src/cryogen_core/compiler.clj index d58c877..a1ed16e 100644 --- a/src/cryogen_core/compiler.clj +++ b/src/cryogen_core/compiler.clj @@ -105,7 +105,7 @@ (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" (Locale/getDefault)) + archive-fmt (java.text.SimpleDateFormat. (get config :archive-group-format "yyyy MMMM") (Locale/getDefault)) formatted-group (.format archive-fmt date)] {:date date :formatted-archive-group formatted-group