Skip to content

Commit

Permalink
fix: Tests by applying qualified keywords throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
munen authored and allentiak committed Nov 2, 2020
1 parent 55288f5 commit 7d48f73
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/io/perun/atom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

0 comments on commit 7d48f73

Please sign in to comment.