-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9d23ca
commit 4d7a431
Showing
2 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: A first post | ||
--- | ||
# A first post | ||
|
||
Declaration of intent to share scrappy fiddles. | ||
|
||
I'm still thinking about whether I am compelled to [normalise sharing scrappy fiddles](https://www.todepond.com/sky/normalise-dont-share-lol/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
(ns com.grahamcarlyle.blog.build | ||
(:require | ||
[babashka.fs :as fs] | ||
[com.grahamcarlyle.blog.posts :as posts] | ||
[clojure.java.io :as io] | ||
[hiccup2.core :as h])) | ||
|
||
(defn declaration-of-intent [] | ||
(h/html [:div | ||
[:p "Declaration of intent to share scrappy fiddles."] | ||
[:p | ||
"I'm still thinking about whether I am compelled to " | ||
[:a | ||
{:href "https://www.todepond.com/sky/normalise-dont-share-lol/"} | ||
"normalise sharing scrappy fiddles"]]])) | ||
|
||
(defn generate [{:keys [output-dir]}] | ||
(fs/delete-tree output-dir) | ||
(fs/create-dirs output-dir) | ||
(spit (io/file output-dir "index.html") (declaration-of-intent))) | ||
(let [result (posts/parse (slurp (io/file "posts" "first-scrappy.md")))] | ||
(spit (io/file output-dir "index.html") (h/html (:hiccup result))))) | ||
|
||
(comment | ||
(build {:output-dir "build-output"}) | ||
(def output-dir "generated-output") | ||
(fs/delete-tree output-dir) | ||
(generate {:output-dir output-dir}) | ||
) |