A fast and simple blog backend.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mediocre-blog/src/gmi/tpl/feed.xml

28 lines
896 B

{{ $getPostsRes := .GetPosts 0 20 -}}
{{ $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>