From 510c33c23d587f2b6d335689aff596a051a6346a Mon Sep 17 00:00:00 2001 From: Shigeaki Matsumura Date: Wed, 19 Oct 2016 00:43:09 +0900 Subject: [PATCH] support sub directories in pages and posts --- src/cryogen_core/compiler.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cryogen_core/compiler.clj b/src/cryogen_core/compiler.clj index ed430b9..85d5ee2 100644 --- a/src/cryogen_core/compiler.clj +++ b/src/cryogen_core/compiler.clj @@ -84,7 +84,8 @@ the file with the given markup." [^java.io.File page config markup] (with-open [rdr (java.io.PushbackReader. (reader page))] - (let [page-name (.getName page) + (let [re-root (re-pattern (str "^.*?(" (:page-root config) "|" (:post-root config) ")/")) + page-name (s/replace (str page) re-root "") file-name (s/replace page-name (re-pattern-from-ext (m/ext markup)) ".html") page-meta (read-page-meta page-name rdr) content ((m/render-fn markup) rdr config)]