|
|
@ -6,12 +6,19 @@
|
|
|
|
(:require [markdown.core :refer [md-to-html-string]]))
|
|
|
|
(:require [markdown.core :refer [md-to-html-string]]))
|
|
|
|
|
|
|
|
|
|
|
|
(def page-header
|
|
|
|
(def page-header
|
|
|
|
[:div#title-container
|
|
|
|
[:div#header
|
|
|
|
[:a {:href "/"}
|
|
|
|
[:div#title
|
|
|
|
[:img#logo {:src "/logo.jpg" :alt "bitgloo logo"}]
|
|
|
|
[:img#logo {:src "/logo.jpg" :alt "bitgloo logo"}]
|
|
|
|
[:h1 "bitgloo"]]])
|
|
|
|
[:a {:href "/"}
|
|
|
|
|
|
|
|
[:h1 "bitgloo"]]]])
|
|
|
|
|
|
|
|
;[:div#subtitle "Electronics design services"]])
|
|
|
|
|
|
|
|
|
|
|
|
(def page-footer [:div#footer [:span "© Clyne Sullivan 2023"]])
|
|
|
|
(def page-menu
|
|
|
|
|
|
|
|
[:div#menu
|
|
|
|
|
|
|
|
[:a.menu-item {:href "/"} "Home"]
|
|
|
|
|
|
|
|
[:a.menu-item {:href "/projects"} "Projects"]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(def page-footer [:div#footer "© Clyne Sullivan 2023"])
|
|
|
|
|
|
|
|
|
|
|
|
(defn md-file? [path] (str/ends-with? path ".md"))
|
|
|
|
(defn md-file? [path] (str/ends-with? path ".md"))
|
|
|
|
|
|
|
|
|
|
|
@ -19,12 +26,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
(defn parse-md-file [file] (-> file slurp md-to-html-string))
|
|
|
|
(defn parse-md-file [file] (-> file slurp md-to-html-string))
|
|
|
|
|
|
|
|
|
|
|
|
(defn render-md-files [file-list] (for [f file-list] [:div.block (parse-md-file f)]))
|
|
|
|
(defn render-md-files [file-list] (for [f file-list] [:div.content (parse-md-file f)]))
|
|
|
|
|
|
|
|
|
|
|
|
(defn load-page [path]
|
|
|
|
(defn load-page [path]
|
|
|
|
(let [file-list (filter md-file? (get-file-list path))]
|
|
|
|
(let [file-list (filter md-file? (get-file-list path))]
|
|
|
|
(when-not (empty? file-list)
|
|
|
|
(when-not (empty? file-list)
|
|
|
|
(page/html5
|
|
|
|
(page/html5
|
|
|
|
[:head [:title "bitgloo"] (page/include-css "/main.css")]
|
|
|
|
[:head [:title "bitgloo"] (page/include-css "/main.css")]
|
|
|
|
[:body page-header [:div#posts (render-md-files file-list)] page-footer]))))
|
|
|
|
[:body [:div#container page-header page-menu (render-md-files file-list) page-footer]]))))
|
|
|
|
|
|
|
|
|
|
|
|