blogamore/layouts/feed/rss.xml

28 lines
1.1 KiB
XML
Raw Normal View History

{{ $baseDir := path.Dir .Page.File }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0">
<channel>
<title>{{ .Page.Params.title }}</title>
<link>{{ .Site.BaseURL }}</link>
<description>{{ .Page.Params.description }}</description>
<language>{{ .Site.LanguageCode }}</language>
<copyright>{{ with .Site.Author.email }}{{.}}{{end}}</copyright>
<pubDate>{{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ range (index .Site.Data ( .Page.Params.dataname )) }}
<item>
<title>{{ .title }}</title>
<description>{{ .comment }}</description>
<link>
{{ if isset . "url" }}
{{- .url | safeURL -}}
{{ else }}
{{- (path.Join $baseDir .filename) | absURL -}}
{{ end }}
</link>
<author>{{ with $.Site.Author.email }}{{.}}{{end}}</author>
<guid></guid>
<pubDate>{{ (time .published).Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
</item>
{{ end }}
</channel>
</rss>