Skip to content

Commit

Permalink
switch to markdown based post
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamcarlyle committed Nov 27, 2024
1 parent a9d23ca commit 4d7a431
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
9 changes: 9 additions & 0 deletions posts/first-scrappy.md
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/)

17 changes: 6 additions & 11 deletions src/main/com/grahamcarlyle/blog/build.clj
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})
)

0 comments on commit 4d7a431

Please sign in to comment.