Files
blog_os/layouts/rss.xml
Philipp Oppermann 555d24698b Use new .Authors instead of deprecated .Author (#216)
This fixes the breaking change introduced by https://github.com/spf13/hugo/issues/2464
2016-09-18 18:16:11 +02:00

26 lines
1.3 KiB
XML

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
{{ $author := .Site.Authors.Get "0"}}
<title>{{ .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with $author.Email }}
<managingEditor>{{.}}{{ with $author.Name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with $author.Email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<atom:link href="{{.URL}}" rel="self" type="application/rss+xml" />
{{ range first 15 (where .Data.Pages "Section" "post") }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with $author.Email }}<author>{{.}}{{ with $author.Name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>