diff --git a/CHANGELOG.md b/CHANGELOG.md index a233728..53e5e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ sections for `Highlights`, `Breaking` and `Changes since x.y.z`. ## [Unreleased] +## [0.6.6] - 2021-10-14 + +### Highlights +- Support a `deps-new` template. + +## [0.6.5] - 2021-10-07 + +### Highlights +- Bump up cryogen-core. + ## [0.6.4] - 2021-10-04 ### Highlights @@ -57,8 +67,11 @@ sections for `Highlights`, `Breaking` and `Changes since x.y.z`. - Switch to `cryogen-flexmark`. - Handle case where `blog-prefix` is blank. -[Unreleased]: https://github.com/cryogen-project/cryogen/compare/0.6.3...HEAD +[Unreleased]: https://github.com/cryogen-project/cryogen/compare/0.6.6...HEAD +[0.6.4]: https://github.com/cryogen-project/cryogen/compare/0.6.5...0.6.6 +[0.6.4]: https://github.com/cryogen-project/cryogen/compare/0.6.4...0.6.5 +[0.6.4]: https://github.com/cryogen-project/cryogen/compare/0.6.3...0.6.4 [0.6.3]: https://github.com/cryogen-project/cryogen/compare/0.6.2...0.6.3 [0.6.2]: https://github.com/cryogen-project/cryogen/compare/0.6.1...0.6.2 [0.6.1]: https://github.com/cryogen-project/cryogen/compare/0.6.0...0.6.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bdfe1fa..6d8e5c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,12 @@ The same [guidelines as in cryogen-core](https://github.com/cryogen-project/cryo Testing ------- -Clone the repo locally and switch to the branch you want to try. Then: - - clojure -Sdeps '{:deps {c/c {:local/root "/path/to/cryogen"}}}' -Tclj-new create :template cryogen :name test1/myblog :force true +Clone the repo locally and switch to the branch you want to try. Then +(if using `clj-new`): +```sh +clojure -Sdeps '{:deps {c/c {:local/root "/path/to/cryogen"}}}' -Tclj-new create :template cryogen :name myname/myblog :force true +``` +Or, if using `deps-new`: +```sh +clojure -Sdeps '{:deps {c/c {:local/root "/path/to/cryogen"}}}' -Tnew :template cryogen :name myname/myblog +``` diff --git a/README.md b/README.md index 7c200e5..f757bfd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@   -This ReadMe only documents a subset of Cryogen's features. For additional documentation please see the [cryogen site](http://cryogenweb.org). +This README only documents a subset of Cryogen's features. For additional documentation please see the [cryogen site](http://cryogenweb.org).   @@ -23,41 +23,58 @@ This ReadMe only documents a subset of Cryogen's features. For additional docume * Sass/SCSS compilation * Klipse Integration -## Prerequisites +## Usage -You will need [Leiningen][1] 2.5.0 or above installed. +### Creating a New Site -[1]: https://github.com/technomancy/leiningen +You can create a new website using either one of `leiningen` or `clj-new` or `deps-new`. -## Usage +#### Creating a New Site With Leiningen -### Creating a New Site +You will need [Leiningen][1] 2.5.0 or above installed. -A new site can be created using the Cryogen template as follows: +[1]: https://github.com/technomancy/leiningen -``` +A new site can be created using the Cryogen leiningen template as follows: + +```sh lein new cryogen my-blog ``` -or, alternatively, using [`clj-new as a tool`](https://github.com/seancorfield/clj-new#installation-as-a-tool): +#### Creating a New Site With clj-new as a Tool -``` +Alternatively, use [`clj-new as a tool`](https://github.com/seancorfield/clj-new#installation-as-a-tool): + +```sh clojure -Ttools install com.github.seancorfield/clj-new '{:git/tag "v1.2.362"}' :as clj-new # update to latest! clojure -Tclj-new create :template cryogen :name myname/myblog :force true cd myname/myblog/ ``` +#### Creating a New Site With deps-new as a Tool + +Alternatively, use [`deps-new as a tool`](https://github.com/seancorfield/deps-new#deps-new-): + +```sh +clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.0"}' :as new +clojure -Sdeps '{:deps {io.github.cryogen-project/cryogen {:git/tag "0.6.6" :git/sha "FILLIN"}}}' -Tnew :template org.cryogenweb/new :name myname/myblog +cd myname/myblog/ +``` + +The artifact `cryogen/lein-template` contains both a leiningen +template and a deps-new template. + ### Running the Server The web server can be started from the `my-blog` directory using either Leiningen: -```bash +```sh lein serve # or lein serve:fast ``` or tools-deps: -```bash +```sh clojure -X:serve # or clojure -X:serve:fast ``` @@ -65,13 +82,13 @@ The server will watch for changes in the `content` and `themes` folders and reco You can also generate the content without bringing up a server either via: -``` +```sh lein run ``` or via: -``` +```sh clojure -M:build ``` @@ -214,6 +231,6 @@ A Clojure library to provide Markdown rendering to the cryogen-core compiler by ## License -Copyright © 2014-2020 Carmen La +Copyright © 2014-2021 Carmen La Distributed under the Eclipse Public License, the same as Clojure. diff --git a/deps.edn b/deps.edn new file mode 100644 index 0000000..c8b453e --- /dev/null +++ b/deps.edn @@ -0,0 +1,2 @@ +{:paths ["resources"] + } diff --git a/project.clj b/project.clj index 16cd338..c5539bd 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject cryogen/lein-template "0.6.5" +(defproject cryogen/lein-template "0.6.6" :description "A Leiningen template for the Cryogen static site generator" :url "https://github.com/cryogen-project/cryogen" :license {:name "Eclipse Public License" diff --git a/resources/org/cryogenweb/new/template.edn b/resources/org/cryogenweb/new/template.edn new file mode 100644 index 0000000..e99e1a2 --- /dev/null +++ b/resources/org/cryogenweb/new/template.edn @@ -0,0 +1,8 @@ +{:transform + [ + ["../../../../src/leiningen/new/cryogen/root" "" {"gitignore" ".gitignore"} :raw] + ["../../../../src/leiningen/new/cryogen/themes" "themes" :raw] + ["../../../../src/leiningen/new/cryogen/content" "content" :raw] + ["../../../../src/leiningen/new/cryogen/src" "src" :raw] + ] + } diff --git a/src/leiningen/new/cryogen.clj b/src/leiningen/new/cryogen.clj index 985cc18..373ae3d 100644 --- a/src/leiningen/new/cryogen.clj +++ b/src/leiningen/new/cryogen.clj @@ -108,24 +108,24 @@ (with-redefs [leiningen.new.templates/render-text (fn [text _] text)] (apply ->files options - [".gitignore" (render "gitignore")] - ["project.clj" (render "project.clj")] - ["deps.edn" (render "deps.edn")] + [".gitignore" (render "root/gitignore")] + ["project.clj" (render "root/project.clj")] + ["deps.edn" (render "root/deps.edn")] ;;static resources - ["content/img/cryogen.png" (resource "img/cryogen.png")] - ["content/css/example.css" (resource "css/example.css")] - ["content/css/sassexample.scss" (resource "css/sassexample.scss")] + ["content/img/cryogen.png" (resource "content/img/cryogen.png")] + ["content/css/example.css" (resource "content/css/example.css")] + ["content/css/sassexample.scss" (resource "content/css/sassexample.scss")] ;;Markdown templates - ["content/md/pages/about.md" (render "md/pages/about.md")] - ["content/md/pages/another-page.md" (render "md/pages/another-page.md")] - ["content/md/posts/2014-03-10-first-post.md" (render "md/posts/2014-03-10-first-post.md")] - ["content/md/posts/2014-11-04-second-post.md" (render "md/posts/2014-11-04-second-post.md")] - ["content/md/posts/2020-12-03-docs.md" (render "md/posts/2020-12-03-docs.md")] + ["content/md/pages/about.md" (render "content/md/pages/about.md")] + ["content/md/pages/another-page.md" (render "content/md/pages/another-page.md")] + ["content/md/posts/2014-03-10-first-post.md" (render "content/md/posts/2014-03-10-first-post.md")] + ["content/md/posts/2014-11-04-second-post.md" (render "content/md/posts/2014-11-04-second-post.md")] + ["content/md/posts/2020-12-03-docs.md" (render "content/md/posts/2020-12-03-docs.md")] ;;Asciidoc templates - ["content/asc/pages/adoc-page.asc" (render "asc/pages/adoc-page.asc")] - ["content/asc/posts/2014-10-10-adoc-post.asc" (render "asc/posts/2014-10-10-adoc-post.asc")] + ["content/asc/pages/adoc-page.asc" (render "content/asc/pages/adoc-page.asc")] + ["content/asc/posts/2014-10-10-adoc-post.asc" (render "content/asc/posts/2014-10-10-adoc-post.asc")] ;;config - ["content/config.edn" (render "config.edn")] + ["content/config.edn" (render "content/config.edn")] ;;namespaces ["src/cryogen/core.clj" (render "src/cryogen/core.clj")] ["src/cryogen/server.clj" (render "src/cryogen/server.clj")] diff --git a/src/leiningen/new/cryogen/asc/pages/adoc-page.asc b/src/leiningen/new/cryogen/content/asc/pages/adoc-page.asc similarity index 100% rename from src/leiningen/new/cryogen/asc/pages/adoc-page.asc rename to src/leiningen/new/cryogen/content/asc/pages/adoc-page.asc diff --git a/src/leiningen/new/cryogen/asc/posts/2014-10-10-adoc-post.asc b/src/leiningen/new/cryogen/content/asc/posts/2014-10-10-adoc-post.asc similarity index 100% rename from src/leiningen/new/cryogen/asc/posts/2014-10-10-adoc-post.asc rename to src/leiningen/new/cryogen/content/asc/posts/2014-10-10-adoc-post.asc diff --git a/src/leiningen/new/cryogen/config.edn b/src/leiningen/new/cryogen/content/config.edn similarity index 100% rename from src/leiningen/new/cryogen/config.edn rename to src/leiningen/new/cryogen/content/config.edn diff --git a/src/leiningen/new/cryogen/css/example.css b/src/leiningen/new/cryogen/content/css/example.css similarity index 100% rename from src/leiningen/new/cryogen/css/example.css rename to src/leiningen/new/cryogen/content/css/example.css diff --git a/src/leiningen/new/cryogen/css/sassexample.scss b/src/leiningen/new/cryogen/content/css/sassexample.scss similarity index 100% rename from src/leiningen/new/cryogen/css/sassexample.scss rename to src/leiningen/new/cryogen/content/css/sassexample.scss diff --git a/src/leiningen/new/cryogen/img/cryogen.png b/src/leiningen/new/cryogen/content/img/cryogen.png similarity index 100% rename from src/leiningen/new/cryogen/img/cryogen.png rename to src/leiningen/new/cryogen/content/img/cryogen.png diff --git a/src/leiningen/new/cryogen/md/pages/about.md b/src/leiningen/new/cryogen/content/md/pages/about.md similarity index 100% rename from src/leiningen/new/cryogen/md/pages/about.md rename to src/leiningen/new/cryogen/content/md/pages/about.md diff --git a/src/leiningen/new/cryogen/md/pages/another-page.md b/src/leiningen/new/cryogen/content/md/pages/another-page.md similarity index 100% rename from src/leiningen/new/cryogen/md/pages/another-page.md rename to src/leiningen/new/cryogen/content/md/pages/another-page.md diff --git a/src/leiningen/new/cryogen/md/posts/2014-03-10-first-post.md b/src/leiningen/new/cryogen/content/md/posts/2014-03-10-first-post.md similarity index 100% rename from src/leiningen/new/cryogen/md/posts/2014-03-10-first-post.md rename to src/leiningen/new/cryogen/content/md/posts/2014-03-10-first-post.md diff --git a/src/leiningen/new/cryogen/md/posts/2014-11-04-second-post.md b/src/leiningen/new/cryogen/content/md/posts/2014-11-04-second-post.md similarity index 100% rename from src/leiningen/new/cryogen/md/posts/2014-11-04-second-post.md rename to src/leiningen/new/cryogen/content/md/posts/2014-11-04-second-post.md diff --git a/src/leiningen/new/cryogen/md/posts/2020-12-03-docs.md b/src/leiningen/new/cryogen/content/md/posts/2020-12-03-docs.md similarity index 100% rename from src/leiningen/new/cryogen/md/posts/2020-12-03-docs.md rename to src/leiningen/new/cryogen/content/md/posts/2020-12-03-docs.md diff --git a/src/leiningen/new/cryogen/deps.edn b/src/leiningen/new/cryogen/root/deps.edn similarity index 100% rename from src/leiningen/new/cryogen/deps.edn rename to src/leiningen/new/cryogen/root/deps.edn diff --git a/src/leiningen/new/cryogen/gitignore b/src/leiningen/new/cryogen/root/gitignore similarity index 100% rename from src/leiningen/new/cryogen/gitignore rename to src/leiningen/new/cryogen/root/gitignore diff --git a/src/leiningen/new/cryogen/project.clj b/src/leiningen/new/cryogen/root/project.clj similarity index 100% rename from src/leiningen/new/cryogen/project.clj rename to src/leiningen/new/cryogen/root/project.clj diff --git a/src/leiningen/new/cryogen/src/cryogen/markup.clj b/src/leiningen/new/cryogen/src/cryogen/markup.clj deleted file mode 100644 index 1fa80ef..0000000 --- a/src/leiningen/new/cryogen/src/cryogen/markup.clj +++ /dev/null @@ -1,33 +0,0 @@ -(ns cryogen.markup - (:require [markdown.core :refer [md-to-html-string]] - [clojure.string :as s] - [cryogen-core.markup :as m]) - (:import org.asciidoctor.Asciidoctor$Factory - java.util.Collections)) - -(defn- markdown [] - (reify m/Markup - (dir [this] "md") - (ext [this] ".md") - (render-fn [this] - (fn [rdr] - (md-to-html-string - (->> (java.io.BufferedReader. rdr) - (line-seq) - (s/join "\n")) - :heading-anchors true))))) - -(defn- asciidoc [] - (reify m/Markup - (dir [this] "asc") - (ext [this] ".asc") - (render-fn [this] - (fn [rdr] - (.convert (Asciidoctor$Factory/create) - (->> (java.io.BufferedReader. rdr) - (line-seq) - (s/join "\n")) - (Collections/emptyMap)))))) - -(defn markups [] - [(markdown) (asciidoc)])