commit 37740488ffbc79ebeb14f68c8f0681b0153ceb85 from: Omar Polo date: Fri Jun 05 15:00:16 2020 UTC added support for toots. while there, a touch of style for the H2s commit - 0ff91bf27174c6e5d1e5242d6a520ec0d1ea5ddf commit + 37740488ffbc79ebeb14f68c8f0681b0153ceb85 blob - 3fc98463bffd350ab35aaa8364c63ea8dfb5683e blob + 74043ffbaf8407c112f3e8c26a21ded8e5637577 --- resources/css/style.css +++ resources/css/style.css @@ -107,6 +107,26 @@ article { margin-bottom: 30px; } +h2::before { + content: "## "; +} + +h3::before { + content: "### "; +} + +h4::before { + content: "#### "; +} + +h5::before { + content: "##### "; +} + +h6::before { + content: "###### "; +} + h1 { position: relative; display: table-cell; @@ -118,24 +138,44 @@ h1 { } /* a cool hack stolen from blog.soykaf.com */ -h1::after { +h1::after, h2.fragment::after { /* should be long enough */ content: '================================================================='; position: absolute; bottom: 0px; left: 0; white-space: nowrap; +} + +h2.fragment { + position: relative; + display: table-cell; + padding: 20px 0 20px; + margin: 0; + overflow: hidden; +} + +h2.fragment::after { + content: '-----------------------------------------------------------------'; } +h2.fragment::before { + content: ''; +} + h1::after, h2::before, h3::before, h4::before, h5::before, h6::before { /* color: hsla(0, 0%, 36%, 1); */ color: #242424; } -h1>a { +h1>a, h2.fragment>a { text-decoration: none; } +h1>a:hover, h2.fragment>a:hover { + text-decoration: underline; +} + h2, h3, h4, h5, h6 { margin: 2rem 0 1rem; } @@ -160,26 +200,6 @@ h6 { font-size: 100%; } -h2::before { - content: "## "; -} - -h3::before { - content: "### "; -} - -h4::before { - content: "#### "; -} - -h5::before { - content: "##### "; -} - -h6::before { - content: "###### "; -} - ul.tags { padding: 0; margin: 0; blob - 9f19fe5f411bbf0abe08ab28f36bc8c04172d61c blob + 20d905d919dc8b342b19e5c891765351c67501a7 --- src/blog/core.clj +++ src/blog/core.clj @@ -16,14 +16,15 @@ out (io/output-stream (io/file dst))] (io/copy in out))) -(defn post [{:keys [slug title short date tags]}] +(defn post [{:keys [slug title short date tags toot]}] (let [f (io/resource (str "posts/" slug ".md"))] - {:slug slug + {:slug slug :title title :short short - :date (time/parse date) - :body (slurp f) - :tags tags})) + :date (time/parse date) + :body (slurp f) + :tags tags + :toot toot})) (def per-tag (atom {})) (def posts (atom [])) @@ -153,6 +154,7 @@ (comment (build) + (clean) (serve) (stop-jetty) ) blob - fbc4b453541f3f1b16f477cce05d20a31c6e0d93 blob + 839cc8f21ad85e99f06478709af4f9b0dda0bb60 --- src/blog/posts.clj +++ src/blog/posts.clj @@ -2,7 +2,8 @@ :slug "elisp-threading-macros" :date "2020/06/04" :tags #{:elisp} - :short "(-> '->> symbol-name (concat \" is so cool\"))"}) + :short "(-> '->> symbol-name (concat \" is so cool\"))" + :toot "https://europecom.net/notice/9vm27kyIDp6oe8h3su"}) (add-post! {:title "Updating the ssh key to ed25519" :slug "upgrading-ssh-key-ed25519" blob - fc9acc11b5c199c8688cee3c0778d702d9c4a32b blob + e1fb801b4ad9510d52ca550aec04fa1cfc3c0069 --- src/blog/templates.clj +++ src/blog/templates.clj @@ -37,16 +37,23 @@ (defn post-fragment [{:keys [full? title-with-link?]} - {:keys [title date slug tags short body], :as post}] + {:keys [title date slug tags short body toot], :as post}] [:article [:header - [:h1 (if title-with-link? - [:a {:href (str "/post/" slug ".html")} title] - title)] + [(if full? + :h1 + :h2.fragment) + (if title-with-link? + [:a {:href (str "/post/" slug ".html")} title] + title)] [:p.author "Written by " [:em "Omar Polo"] " on " (time/fmt-loc date)] [:ul.tags (map #(vector :li [:a {:href (str "/tag/" (name %) ".html")} (str "#" (name %))]) - tags)]] + tags)] + (when toot + [:p [:a {:href toot, + :target "_blank" + :rel "noopener"} "Comments over ActivityPub"]])] [:section (if full? (markdown->hiccup default-config body)