blog/layouts/index.atom.xml

38 lines
1.5 KiB
XML
Raw Permalink Normal View History

2023-04-17 15:54:12 +00:00
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link href="{{ .Permalink }}index.xml" rel="self"/>
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
2024-06-13 02:45:57 +00:00
<id>{{ .Permalink }}</id>{{ with .Site.Params.Author.name }}
2023-04-17 15:54:12 +00:00
<author>
2024-06-13 02:45:57 +00:00
<name>{{.}}</name>{{ with $.Site.Params.Author.email }}
2023-04-17 15:54:12 +00:00
<email>{{.}}</email>{{end}}
</author>{{end}}
<generator>Hugo -- gohugo.io</generator>{{ range $pages }}
<entry>
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
<link href="{{ .Permalink }}"/>
2024-06-13 02:45:57 +00:00
<id>{{ .Permalink }}</id>{{ with $.Site.Params.Author.name }}
2023-04-17 15:54:12 +00:00
<author>
<name>{{.}}</name>
</author>{{end}}
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ if .Content }}
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>
{{ end }}
</entry>{{ end }}
</feed>