<?xml version= "1.0" encoding= "utf-8" ?>
<feed xmlns= "http://www.w3.org/2005/Atom" >
<title>{{(get-in args [:blog :title])}}</title>
<link href="https://{{ (get-in args [:blog :url]) }}" />
<link rel="self" href="https://{{ (get-in args [:blog :url]) }}/feed.xml" />
<updated>{{(let [first-post (first (public-posts args))]
(string/format "%sT00:00:00Z" (first-post :date)))}}</updated>
<author>
<name>{{(get-in args [:blog :author])}}</name>
</author>
<id>https://{{(get-in args [:blog :url])}}/</id>
{% (loop [post :in (public-posts args)]
(def full-url (bagatto/format "https://%s%s/posts/%s.html"
(get-in args [:blog :url])
(args :root)
(bagatto/slugify (post :title))))
(def item ```
<entry>
<title>%s</title>
<link href="%s" />
<id>%s</id>
<updated>%sT00:00:00.00Z</updated>
<content type="text/html" src="%s"/>
<summary>%s...</summary>
</entry>
```)
(print (bagatto/format item
(post :title)
full-url
full-url
(post :date)
full-url
(->> (post :body)
(string/split "\n")
(map string/trim)
(filter (complement empty?))
(first))))) %}
</feed>