diff options
Diffstat (limited to 'src/gmi/tpl')
-rw-r--r-- | src/gmi/tpl/feed.xml | 28 | ||||
-rw-r--r-- | src/gmi/tpl/posts/index.gmi | 2 |
2 files changed, 29 insertions, 1 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> diff --git a/src/gmi/tpl/posts/index.gmi b/src/gmi/tpl/posts/index.gmi index dd4c84c..9d0f6e2 100644 --- a/src/gmi/tpl/posts/index.gmi +++ b/src/gmi/tpl/posts/index.gmi @@ -9,7 +9,7 @@ {{ end -}} {{ range $getPostsRes.Posts -}} -=> /posts/{{ .ID }}.gmi {{ .PublishedAt.Format "2006-01-02" }} - {{ .Title }} +=> {{ PostURL .ID }} {{ .PublishedAt.Format "2006-01-02" }} - {{ .Title }} {{ end -}} |