3 b75f3ee4 2020-10-03 op [blog.gemtext :as gemtext]
4 b75f3ee4 2020-10-03 op [blog.time :as time]
5 b75f3ee4 2020-10-03 op [clojure.data.xml :refer :all]
6 b75f3ee4 2020-10-03 op [commonmark-hiccup.core :refer [markdown->hiccup default-config]]
7 b75f3ee4 2020-10-03 op [hiccup.core :as hiccup]))
9 bade790b 2020-11-05 op (defn item [linkfn {:keys [title date slug tags short body gemtext?]}]
10 bade790b 2020-11-05 op (let [link (linkfn slug)]
12 a803b55b 2020-03-30 op [:title title]
18 bade790b 2020-11-05 op (-> body gemtext/parse gemtext/to-hiccup)
19 bade790b 2020-11-05 op (markdown->hiccup default-config body)))]])
22 a803b55b 2020-03-30 op [:pubDate (time/fmt-rfc-2822 date)]]))
24 bade790b 2020-11-05 op (defn feed [linkfn posts]
26 a803b55b 2020-03-30 op (sexp-as-element
27 a803b55b 2020-03-30 op [:rss {:version "2.0" :xmlns:atom "http://www.w3.org/2005/Atom"}
29 a803b55b 2020-03-30 op [:title "yumh"]
30 a803b55b 2020-03-30 op [:description "Writing about things, sometimes"]
31 a803b55b 2020-03-30 op [:link "https://www.omarpolo.com"]
32 a803b55b 2020-03-30 op ;; fails to validate?
33 a803b55b 2020-03-30 op ;; [:atom:link {:href "https://www.omarpolo.com/rss.xml" :ref "self" :type "application/rss+xml"} nil]
34 bade790b 2020-11-05 op (map (partial item linkfn)