blob: 9b7cdb4ba3168be2b93d80f107b58264cf2838fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- $langCode := .Site.LanguageCode | default "en-us" -}}
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ $langCode }}">
<title>{{ .Site.Title }}</title>
<subtitle>{{ partial "meta-subtitle" . | plainify }}</subtitle>
<id>{{ "/" | absLangURL }}</id>
<author>
<name>{{ .Site.Title }}</name>
<uri>{{ "/" | absLangURL }}</uri>
</author>
{{- with .Site.Copyright }}
<rights>{{ . }}</rights>
{{- end }}
{{- with .Site.Params.image.icon1To1 }}
<icon>{{ partial "cdn-src" (dict "Site" $.Site "Page" . "src" .) | absURL }}</icon>
{{- end }}
{{- with .Site.Params.image.icon2To1 }}
<logo>{{ partial "cdn-src" (dict "Site" $.Site "Page" . "src" .) | absURL }}</logo>
{{- end }}
<updated>{{ dateFormat "2006-01-02T15:04:05Z" now.UTC | safeHTML }}</updated>
{{- with .OutputFormats.Get "ATOM" }}
{{ printf `<link rel="self" type="%s" href="%s" hreflang="%s"/>` .MediaType.Type .Permalink $langCode | safeHTML }}
{{- end }}
{{- range .AlternativeOutputFormats }}
{{ printf `<link rel="alternate" type="%s" href="%s" hreflang="%s"/>` .MediaType.Type .Permalink $langCode | safeHTML }}
{{- end }}
{{- range $pages }}
<entry>
<title>{{ .Title }}</title>
{{- $author := partial "author-data" . }}
<author>
<name>{{ $author.name }}</name>
<uri>{{ $author.uri }}</uri>
</author>
<id>{{ .Permalink }}</id>
{{- if .IsTranslated -}}
{{ range .Translations }}
<link rel="alternate" href="{{ .Permalink }}" hreflang="{{ .Language.Lang }}"/>
{{- end -}}
{{ end }}
<updated>{{ dateFormat "2006-01-02T15:04:05Z" .Lastmod.UTC | safeHTML }}</updated>
<published>{{ dateFormat "2006-01-02T15:04:05Z" .Date.UTC | safeHTML }}</published>
<content type="html">{{ printf "<![CDATA[%s]]>" (chomp .Content) | safeHTML }}</content>
</entry>
{{- end }}
</feed>
|