Compare commits

..

No commits in common. "eb709b9555f3e42bf2d0a7778d0cbc79f65299c5" and "137705e81c02600a390c35f885c143a5476ea073" have entirely different histories.

5 changed files with 11 additions and 31 deletions

View file

@ -13,7 +13,7 @@
Additional Features: Additional Features:
* Navmap feature for nested navigation (see: https://github.com/cryogen-project/cryogen-core/pull/81) * Navmap feature for nested navigation (see: https://github.com/cryogen-project/cryogen-core/pull/81)
* Spring like Overlay-Filesystem: Theme can be published bundled in a jar but you can easily place your overwrites in filesystem. * Theme default can be read from classpath, filesystem overwrites.
## License ## License

View file

@ -1,11 +1,11 @@
(defproject dda/cryogen-core "0.2.4-SNAPSHOT" (defproject dda/cryogen-core "0.2.1-SNAPSHOT"
:description "Cryogen's compiler" :description "Cryogen's compiler"
:url "https://github.com/cryogen-project/cryogen-core" :url "https://github.com/cryogen-project/cryogen-core"
:license {:name "Eclipse Public License" :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"} :url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"] :dependencies [[org.clojure/clojure "1.10.1"]
[camel-snake-kebab "0.4.1"] [camel-snake-kebab "0.4.1"]
[cheshire "5.10.0"] [cheshire "5.9.0"]
[clj-rss "0.2.5"] [clj-rss "0.2.5"]
[clj-text-decoration "0.0.3"] [clj-text-decoration "0.0.3"]
[enlive "1.1.6"] [enlive "1.1.6"]
@ -29,13 +29,4 @@
:exclusions [commons-logging]}} :exclusions [commons-logging]}}
:test {:source-paths ["test"] :test {:source-paths ["test"]
:resource-paths ["test-resources"] :resource-paths ["test-resources"]
:dependencies [[dda/dummy "0.1.0-SNAPSHOT"]]}} :dependencies [[dda/dummy "0.1.0-SNAPSHOT"]]}})
:release-tasks [["vcs" "assert-committed"]
["change" "version" "leiningen.release/bump-version" "release"]
["vcs" "commit"]
["vcs" "tag"]
["deploy"]
["uberjar"]
["change" "version" "leiningen.release/bump-version"]
["vcs" "commit"]
["vcs" "push"]])

View file

@ -34,19 +34,10 @@
[ignore-patterns source-list] [ignore-patterns source-list]
(filter #(not (re-matches (re-pattern ignore-patterns) %)) source-list)) (filter #(not (re-matches (re-pattern ignore-patterns) %)) source-list))
(defn filter-one-pattern
[ignore-patterns resources]
(if (not (empty? (:virtual-path (first resources))))
(filter #(not (re-matches ignore-patterns (:virtual-path %))) resources)
resources))
(defn filter-resources-for-ignore-patterns (defn filter-resources-for-ignore-patterns
[ignore-patterns resources] [ignore-patterns resources]
(let [ignore-patterns (into [] ignore-patterns) (filter #(not (re-matches (re-pattern ignore-patterns) (:virtual-path %)))
pattern (peek ignore-patterns)] resources))
(if pattern
(filter-resources-for-ignore-patterns (pop ignore-patterns) (filter-one-pattern pattern resources))
resources)))
(defn resource-from-cp-or-fs ;:- Resource (defn resource-from-cp-or-fs ;:- Resource
[fs-prefix ;:- Prefix [fs-prefix ;:- Prefix

View file

@ -41,9 +41,8 @@
(let [base-path "templates/md" (let [base-path "templates/md"
resources (cp-io/get-resources resources (cp-io/get-resources
fs-prefix base-path [pages posts]) fs-prefix base-path [pages posts])
filtered-resources (cp-io/filter-resources-for-ignore-patterns ignore-patterns filtered-resources (->> (filter #(= (:resource-type %) :dir) resources)
(->> (filter #(= (:resource-type %) :dir) resources) (cp-io/distinct-resources-by-path))]
(cp-io/distinct-resources-by-path)))]
filtered-resources)) filtered-resources))
(defn create-dirs-from-markup-folders! (defn create-dirs-from-markup-folders!
@ -76,7 +75,6 @@ if no, return empty vector."
(->> assets (->> assets
filter-file filter-file
filter-ext filter-ext
(cp-io/filter-resources-for-ignore-patterns ignored-files)
(map get-java-file)))) (map get-java-file))))
; ;

View file

@ -28,7 +28,7 @@
(sut/get-distinct-markup-dirs (sut/get-distinct-markup-dirs
"./not-existing-get-from-cp" "./not-existing-get-from-cp"
"test_posts" "test_pages" "test_posts" "test_pages"
[#""])))))) ""))))))
(deftest test-create-dirs-from-markup-folders! (deftest test-create-dirs-from-markup-folders!
(is (is
@ -38,7 +38,7 @@
"./not-existing-get-from-cp" "./not-existing-get-from-cp"
"test_posts" "test_posts"
"test_pages" "test_pages"
target-tmp [#""]) target-tmp "")
(and (ftt/verify-dir-exists (and (ftt/verify-dir-exists
(str target-tmp "/test_pages")) (str target-tmp "/test_pages"))
(ftt/verify-dir-exists (ftt/verify-dir-exists
@ -50,7 +50,7 @@
(is (is
(let [target-tmp "target/tmp-test-copy-resources-from-theme"] (let [target-tmp "target/tmp-test-copy-resources-from-theme"]
(sut/delete-resources! target-tmp) (sut/delete-resources! target-tmp)
(sut/copy-resources-from-theme! "./" theme target-tmp [#""]) (sut/copy-resources-from-theme! "./" theme target-tmp "")
(and (ftt/verify-dir-exists (and (ftt/verify-dir-exists
(str target-tmp "/js")) (str target-tmp "/js"))
(ftt/verify-file-exists (ftt/verify-file-exists