Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for a deps-new template #245

Merged
merged 11 commits into from
Oct 15, 2021
Merged
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
47 changes: 32 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Non-breaking space -->
&nbsp;

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).

<!-- Non-breaking space -->
&nbsp;
Expand All @@ -23,55 +23,72 @@ 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
```

The server will watch for changes in the `content` and `themes` folders and recompile the content automatically. The `*:fast` variants perform [fast but partial compilation](https://cryogenweb.org/docs/fast-compilation.html) of only the changed page/post.

You can also generate the content without bringing up a server either via:

```
```sh
lein run
```

or via:

```
```sh
clojure -M:build
```

Expand Down Expand Up @@ -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.
2 changes: 2 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{:paths ["resources"]
}
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 8 additions & 0 deletions resources/org/cryogenweb/new/template.edn
Original file line number Diff line number Diff line change
@@ -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]
]
}
28 changes: 14 additions & 14 deletions src/leiningen/new/cryogen.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
33 changes: 0 additions & 33 deletions src/leiningen/new/cryogen/src/cryogen/markup.clj

This file was deleted.