diff --git a/src/website/core.clj b/src/website/core.clj index 200c963..ad9dd16 100644 --- a/src/website/core.clj +++ b/src/website/core.clj @@ -1,5 +1,17 @@ (ns website.core - :require [clojure.java.io :as io]) + (:require [clojure.java.io :as io])) + + +(def template-dir "./site/templates") + +;; Thank you https://clojure.org/api/cheatsheet +(def template-map + "Grab all files in the template directory and insert them into a map with +the filenames as keyword keys" + (let [files (filter #(.isFile %) (file-seq (io/file template-dir))) + ] (mapcat #(assoc {} (keyword (.getName %)) (slurp %)) files))) + + (defn foo "I don't do a whole lot."