From 4afdb823d84e040f287340732cc825154fec8ada Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 21 Feb 2020 16:10:30 +0100 Subject: [PATCH 1/4] move content to the right place --- src/cryogen_core/compiler.clj | 5 +++-- src/cryogen_core/new_io.clj | 4 ++-- src/cryogen_core/sitemap.clj | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cryogen_core/compiler.clj b/src/cryogen_core/compiler.clj index d6dc776..d63f98e 100644 --- a/src/cryogen_core/compiler.clj +++ b/src/cryogen_core/compiler.clj @@ -43,10 +43,11 @@ looking under the implemented protocol's subdirectory, but fallsback to look at the templates directory." [root mu ignored-files] - (let [assets (new-io/find-assets (str "templates/" (m/dir mu)) [root] (m/ext mu) ignored-files)] + (let [assets (new-io/find-assets "content" (str "templates/" (m/dir mu)) + [root] (m/ext mu) ignored-files)] (if (seq assets) assets - (new-io/find-assets "templates" [root] (m/ext mu) ignored-files)))) + (new-io/find-assets "content" "templates" [root] (m/ext mu) ignored-files)))) (defn find-posts "Returns a list of markdown files representing posts under the post root." diff --git a/src/cryogen_core/new_io.clj b/src/cryogen_core/new_io.clj index 4e6b80a..a2351f6 100644 --- a/src/cryogen_core/new_io.clj +++ b/src/cryogen_core/new_io.clj @@ -71,8 +71,8 @@ extension (ext) ignoring any files that match the given (ignored-files). First make sure that the root directory exists, if yes: process as normal; if no, return empty vector." - [base-path paths ext ignored-files] - (let [assets (cp-io/get-resources "content" base-path paths) + [fs-prefix base-path paths ext ignored-files] + (let [assets (cp-io/get-resources fs-prefix base-path paths) filter-file (fn [xs] (filter #(= (:resource-type %) :file) xs)) filter-ext (fn [xs] (filter #(= (get-file-extension-from-resource %) ext) xs)) cast-file (fn [java-path] (io/as-file (.toString java-path))) diff --git a/src/cryogen_core/sitemap.clj b/src/cryogen_core/sitemap.clj index 75a2868..995862b 100644 --- a/src/cryogen_core/sitemap.clj +++ b/src/cryogen_core/sitemap.clj @@ -19,7 +19,7 @@ {:tag :urlset :attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"} :content - (for [^java.io.File f (new-io/find-assets "" ["public"] ".html" ignored-files)] + (for [^java.io.File f (new-io/find-assets "content" "" ["public"] ".html" ignored-files)] {:tag :url :content [{:tag :loc From 4a2e9db68c6912f0b56889e104acc074890b41cc Mon Sep 17 00:00:00 2001 From: jem Date: Sat, 22 Feb 2020 13:50:29 +0100 Subject: [PATCH 2/4] enable theme images --- src/cryogen_core/new_io.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryogen_core/new_io.clj b/src/cryogen_core/new_io.clj index a2351f6..5a70367 100644 --- a/src/cryogen_core/new_io.clj +++ b/src/cryogen_core/new_io.clj @@ -19,7 +19,7 @@ (defn copy-resources-from-theme! [fs-prefix theme target-path ignore-patterns] (let [theme-path (str "templates/themes/" theme)] - (cp-io/copy-resources! fs-prefix theme-path ["css" "js"] + (cp-io/copy-resources! fs-prefix theme-path ["css" "js" "img"] target-path ignore-patterns) (cp-io/copy-resources! fs-prefix (str theme-path "/html") ["404.html"] target-path ignore-patterns))) From e64242948ee0dd06731a1a3516c3138265f84d6f Mon Sep 17 00:00:00 2001 From: jem Date: Sat, 22 Feb 2020 15:43:45 +0100 Subject: [PATCH 3/4] Version 0.2.0 --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 8ccae14..e6912c4 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject dda/cryogen-core "0.2.0-SNAPSHOT" +(defproject dda/cryogen-core "0.2.0" :description "Cryogen's compiler" :url "https://github.com/cryogen-project/cryogen-core" :license {:name "Eclipse Public License" From df0c9867a91d65526a783a785cb97e4e5a62710c Mon Sep 17 00:00:00 2001 From: jem Date: Sat, 22 Feb 2020 15:44:05 +0100 Subject: [PATCH 4/4] Version 0.2.1-SNAPSHOT --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index e6912c4..23bdf58 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject dda/cryogen-core "0.2.0" +(defproject dda/cryogen-core "0.2.1-SNAPSHOT" :description "Cryogen's compiler" :url "https://github.com/cryogen-project/cryogen-core" :license {:name "Eclipse Public License"