diff --git a/src/io/perun/atom.clj b/src/io/perun/atom.clj index d34428bb..42649ca1 100644 --- a/src/io/perun/atom.clj +++ b/src/io/perun/atom.clj @@ -42,48 +42,48 @@ atom (xml/emit-str (xml/sexp-as-element [::atom/feed {:xmlns "http://www.w3.org/2005/Atom"} - [:title site-title] + [::atom/title site-title] (when (seq description) - [:subtitle description]) - [:generator {:uri "https://perun.io/" :version version} "Perun"] - [:link {:href base-url :type "text/html"}] - [:link {:href canonical-url :rel "self"}] - [:link {:href (:first navs) :rel "first"}] - [:link {:href (:last navs) :rel "last"}] + [::atom/subtitle description]) + [::atom/generator {:uri "https://perun.io/" :version version} "Perun"] + [::atom/link {:href base-url :type "text/html"}] + [::atom/link {:href canonical-url :rel "self"}] + [::atom/link {:href (:first navs) :rel "first"}] + [::atom/link {:href (:last navs) :rel "last"}] (when-let [next (:next navs)] - [:link {:href next :rel "next"}]) + [::atom/link {:href next :rel "next"}]) (when-let [prev (:prev navs)] - [:link {:href prev :rel "previous"}]) - [:updated (->> entries + [::atom/link {:href prev :rel "previous"}]) + [::atom/updated (->> entries (map (comp iso-datetime updated first)) sort reverse first)] - [:id base-url] + [::atom/id base-url] (when global-author - [:author - [:name global-author] + [::atom/author + [::atom/name global-author] (when global-author-email - [:email global-author-email])]) + [::atom/email global-author-email])]) (for [{:keys [uuid canonical-url title author author-email category tags content] :as post} entries :let [author (or author global-author) author-email (or author-email global-author-email)]] - [:entry - [:id (str "urn:uuid:" uuid)] - [:title title] + [::atom/entry + [::atom/id (str "urn:uuid:" uuid)] + [::atom/title title] (when canonical-url - [:link {:href canonical-url :type "text/html" :title title :rel "alternate"}]) - [:published (iso-datetime (published post))] - [:updated (iso-datetime (updated post))] - [:content {:type "html" :xml:base canonical-url} (str content)] - [:author - [:name author] - (when author-email [:email author-email])] + [::atom/link {:href canonical-url :type "text/html" :title title :rel "alternate"}]) + [::atom/published (iso-datetime (published post))] + [::atom/updated (iso-datetime (updated post))] + [::atom/content {:type "html" :xml:base canonical-url} (str content)] + [::atom/author + [::atom/name author] + (when author-email [::atom/email author-email])] (for [tag tags] ;; FIXME: post-image media:thumbnail - [:category {:term tag}])])]))] + [::atom/category {:term tag}])])]))] (assoc entry :rendered atom)))