summaryrefslogtreecommitdiff
path: root/src/gmi/tpl/feed.xml
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2023-01-22 12:45:03 +0100
committerBrian Picciano <mediocregopher@gmail.com>2023-01-22 12:45:03 +0100
commit5b5a0438682ecb69bbc8d7cb9904ad4b049033a3 (patch)
treebf5a689a3df4cbf9bd6188928d79d67517be63b3 /src/gmi/tpl/feed.xml
parent1cfdac5e8c2ac802275cb29ae9149c55547f38fb (diff)
Implement gemini atom feed
Diffstat (limited to 'src/gmi/tpl/feed.xml')
-rw-r--r--src/gmi/tpl/feed.xml28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gmi/tpl/feed.xml b/src/gmi/tpl/feed.xml
new file mode 100644
index 0000000..497fb11
--- /dev/null
+++ b/src/gmi/tpl/feed.xml
@@ -0,0 +1,28 @@
+{{ $getPostsRes := .GetPosts 0 15 -}}
+{{ $posts := $getPostsRes.Posts -}}
+
+<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom">
+ <title>mediocregopher's lil web corner</title>
+ <id>{{ BlogURLAbs "/" }}</id>
+ {{ if gt (len $posts) 0 -}}
+ <updated>{{ (index $posts 0).PublishedAt.Format "2006-01-02T15:04:05Z07:00" }}</updated>
+ {{ end -}}
+ <link href="{{ BlogURLAbs "/" }}"></link>
+ <author>
+ <name>mediocregopher</name>
+ </author>
+ {{ range $posts -}}
+ <entry>
+ <title>{{ .Title }}</title>
+ <updated>{{ .PublishedAt.Format "2006-01-02T15:04:05Z07:00" }}</updated>
+ <id>{{ PostURLAbs .ID }}</id>
+ <link href="{{ PostURLAbs .ID }}" rel="alternate"></link>
+ {{ if .Description -}}
+ <summary type="html">{{ .Description }}</summary>
+ {{ end -}}
+ <author>
+ <name>mediocregopher</name>
+ </author>
+ </entry>
+ {{ end -}}
+</feed>