1
0
Fork 0
website/src/site/core.clj

37 lines
1.6 KiB
Clojure
Raw Normal View History

2019-10-27 16:20:04 -05:00
(ns site.core
2020-09-28 02:47:53 -05:00
(:require [hiccup.page :as hp]))
2020-05-12 03:24:27 -05:00
2019-10-27 16:20:04 -05:00
2020-09-28 02:47:53 -05:00
(defn format-time [time] (.format (-> time .toInstant (.atZone (java.time.ZoneId/systemDefault)) .toLocalDate) (java.time.format.DateTimeFormatter/ofPattern "MMM d, yyyy")))
(defn page [{global-meta :meta posts :entries post :entry}]
2019-10-27 16:20:04 -05:00
(hp/html5
2020-09-17 23:03:34 -05:00
[:head
[:meta {:charset "utf-8"}]
[:link {:rel "stylesheet" :href "main.css"}]]
2020-09-28 02:47:53 -05:00
[:title "Homepage of Kaan Genç"]
2020-09-17 23:03:34 -05:00
[:link {:href
"https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,700;1,400;1,700&display=swap"
:rel "stylesheet"}]
2020-09-28 02:47:53 -05:00
[:div.sidebar.column
[:img.picture {:alt "A photo of Kaan Genç, after his OOPSLA 2019 talk." :src "/img/profile.jpg"}]
[:div.name "Kaan Genç"]
[:div.title "PhD Student"]
[:div.department "Computer Science & Engineering"]
[:div.affiliation "The Ohio State University"]
[:span [:a.email {:href "mailto:genc.5@osu.edu"} "genc.5@osu.edu"] [:a.gpg {:href "/extra/kaangenc.gpg"} "GPG key"]]
[:a.github {:href "https://github.com/SeriousBug"} "Github"]
[:a.github {:href "https://twitter.com/KaanGencCS"} "Twitter"]
[:a.researchr {:href "https://conf.researchr.org/profile/kaangenc"} "Researchr"]
[:a.cv {:href "/extra/cv.pdf"} "CV"]]
(if (= "index" (:slug post))
;; Index page
[:div.main.column (:content post)]
;; Blog post
[:div.main.column
[:h1.post-title (:title post)]
[:div.date "Written at " (-> post :date format-time)]
(when (:modified post) [:div.modified "Last edited at " (-> post :modified format-time)])
(:content post)])))