Files
blog/themes/Ying/layouts/_default/rss.xml
T
2024-07-28 16:57:25 +08:00

33 lines
1.7 KiB
XML

{{- $pctx := . -}}
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq $pctx.Title $pctx.Site.Title }}{{ $pctx.Site.Title }}{{ else }}{{ with $pctx.Title }}{{ . }} on {{ end }}{{ $pctx.Site.Title }}{{ end }}</title>
<link>{{ $pctx.Permalink }}</link>
<description>Recent content {{ if ne $pctx.Title $pctx.Site.Title }}{{ with $pctx.Title }}in {{ . }} {{ end }}{{ end }}on {{ $pctx.Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
{{ with $pctx.Site.LanguageCode }}<language>{{ . }}</language>{{ end }}
{{ with $pctx.Site.Author.email }}
<managingEditor>{{ . }}{{ with $pctx.Site.Author.name }} ({{ . }}){{ end }}</managingEditor>
<webMaster>{{ . }}{{ with $pctx.Site.Author.name }} ({{ . }}){{ end }}</webMaster>
{{ end }}
{{ with $pctx.Site.Copyright }}<copyright>{{ . }}</copyright>{{ end }}
{{ if not $pctx.Date.IsZero }}
<lastBuildDate>{{ $pctx.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
{{ end }}
{{- with $pctx.OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
{{ range $pctx.Pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with $pctx.Site.Author.email }}<author>{{ . }}{{ with $pctx.Site.Author.name }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>