Embed IBM plex and use sass

This commit is contained in:
heyarne 2021-07-30 00:17:45 +02:00
commit a9321013d8
254 changed files with 1428 additions and 41 deletions

View file

@ -54,23 +54,24 @@
x2 y2)}]))
(def num-tiles 10)
(def width 160)
(def height 160)
(def width 500)
(def height 500)
(def half-pi (/ math/pi 2))
(defn ten-print
"Generates a unique SVG pattern for some given content."
[content]
(let [xs (map |(* width (/ $0 num-tiles)) (range (+ num-tiles 1)))
ys (map |(* height (/ $0 num-tiles)) (range (+ num-tiles 1)))
radius (/ width num-tiles 2)]
(let [radius (/ width num-tiles 2)
xs (map |(* width (/ $0 num-tiles)) (range (+ num-tiles 1)))
ys (map |(* height (/ $0 num-tiles)) (range (+ num-tiles 1)))]
(math/seedrandom (hash content))
[:svg {:viewBox (string/format "0 0 %d %d" width height)
:xmlns "http://www.w3.org/2000/svg"
:width width
:height height
:style "overflow: visible"}
[:g {:transform "translate(0.5, 0.5)"}
[:svg.ten-print
{:viewBox (string/format "%d %d %d %d" (- radius) (- radius)
(+ width (* 2 radius))
(+ height (* 2 radius)))
:xmlns "http://www.w3.org/2000/svg"
:style "overflow: visible"}
[:g {:transform "translate(0.5, 0.5"}
(mapcat
(fn [y]
(map (fn [x]
@ -84,14 +85,16 @@
You can call this with some content and have it generate an entire HTML
structure for you.
```
[data body &opt raw?]
[data nav body &opt raw?]
(default raw? false)
(as-html [(html-head data)
[:body
[:main
[:header
(ten-print body)]
[:article (if raw? (html/raw body) body)]]]]))
[:aside
(ten-print body)
[:h1 (get-in data [:config :title])]
[:nav nav]]
[:article (if raw? (html/raw body) body)]]]]))
#
# different page types
@ -102,6 +105,7 @@
(defn home [data]
(base data
[]
[[:h1 "Projects"]
[:ul
[:li "Berliner Winter"]
@ -114,4 +118,9 @@
[:li [:a {:href (utils/slugify-content data post)} (post "title")]]) (data :posts))]]))
(defn post [data item]
(base data (bagatto/mmarkdown->html (item :contents)) true))
(base data
[:ul
[:li [:a {:href "#"}] "Projects"]
[:li [:a {:href "#"}] "Posts"]
[:li [:a {:href "#"}] "About"]]
(bagatto/mmarkdown->html (item :contents)) true))