~subsetpark/subsetpark

ref: 2b0f78966109d777231798be0bf861f26e9a58f8 subsetpark/temple/feed.temple -rw-r--r-- 1.3 KiB
2b0f7896 — Zach Smith Addendum with links to source 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?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]) }}"/>
  <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>%s</content>
                  </entry>
                  ```)
        
        (print (bagatto/format item
                  (post :title)
                  full-url
                  full-url
                  (post :date)
                  (-> (post :body) (bagatto/markdown->html :exts [:table]))))) %}

</feed>