Compare commits

...

10 commits

Author SHA1 Message Date
eb709b9555
Update README.md 2020-03-07 16:53:44 +01:00
jem
c19068c872 Version 0.2.4-SNAPSHOT 2020-03-07 13:11:00 +01:00
jem
3e2581f475 Version 0.2.3 2020-03-07 13:10:40 +01:00
jem
7e365f9c22 Version 0.2.3-SNAPSHOT 2020-03-07 13:08:27 +01:00
jem
243d3679c2 Version 0.2.2 2020-03-07 13:08:01 +01:00
lukas
ee937e05fe filters now work with vectors intead of strings 2020-03-06 18:38:18 +01:00
lukas
afeef539b5 Version 0.2.2-SNAPSHOT 2020-03-05 15:20:52 +01:00
lukas
0d9fd29ea7 Version 0.2.1 2020-03-05 15:20:25 +01:00
lukas
dc7d345094 added release-tasks 2020-03-05 15:19:46 +01:00
lukas
423790edb1 ignore-patterns should work 2020-02-26 11:28:47 +01:00
5 changed files with 31 additions and 11 deletions

View file

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

View file

@ -1,11 +1,11 @@
(defproject dda/cryogen-core "0.2.1-SNAPSHOT"
(defproject dda/cryogen-core "0.2.4-SNAPSHOT"
:description "Cryogen's compiler"
:url "https://github.com/cryogen-project/cryogen-core"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]
[camel-snake-kebab "0.4.1"]
[cheshire "5.9.0"]
[cheshire "5.10.0"]
[clj-rss "0.2.5"]
[clj-text-decoration "0.0.3"]
[enlive "1.1.6"]
@ -29,4 +29,13 @@
:exclusions [commons-logging]}}
:test {:source-paths ["test"]
: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,10 +34,19 @@
[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
[ignore-patterns resources]
(filter #(not (re-matches (re-pattern ignore-patterns) (:virtual-path %)))
resources))
(let [ignore-patterns (into [] ignore-patterns)
pattern (peek ignore-patterns)]
(if pattern
(filter-resources-for-ignore-patterns (pop ignore-patterns) (filter-one-pattern pattern resources))
resources)))
(defn resource-from-cp-or-fs ;:- Resource
[fs-prefix ;:- Prefix

View file

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

View file

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