From 852b431d71cff5b560e2bc382aae7b4f2373a2c9 Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 4 Feb 2016 03:43:47 -0800 Subject: [PATCH] Add home to index params when previews are enabled --- src/cryogen_core/compiler.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cryogen_core/compiler.clj b/src/cryogen_core/compiler.clj index cccec50..6f9ff26 100644 --- a/src/cryogen_core/compiler.clj +++ b/src/cryogen_core/compiler.clj @@ -292,11 +292,13 @@ (create-preview-links blog-prefix)) previews (if (> (count previews) 1) (assoc-in previews [1 :prev] (path "/" blog-prefix "index.html")) previews)] (create-folder (path "/" blog-prefix "p")) - (doseq [{:keys [index posts prev next]} previews] - (create-file (if (= 1 index) (path "/" blog-prefix "index.html") (path "/" blog-prefix "p" (str index ".html"))) + (doseq [{:keys [index posts prev next]} previews + :let [index-page? (= 1 index)]] + (create-file (if index-page? (path "/" blog-prefix "index.html") (path "/" blog-prefix "p" (str index ".html"))) (render-file "/html/previews.html" (merge params {:active-page "preview" + :home (when index-page? true) :servlet-context (path "/" blog-prefix "/") :posts posts :prev-uri prev