Add section.atom templates to blog and photos that are identical to the home feed
This commit is contained in:
parent
1ce9e2b417
commit
d18edef261
2 changed files with 58 additions and 0 deletions
29
layouts/blog/section.atom.atom
Normal file
29
layouts/blog/section.atom.atom
Normal file
|
@ -0,0 +1,29 @@
|
|||
{{- $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 -}}
|
||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>{{ .Site.Title }}</title>
|
||||
<link href="{{ .Permalink }}" />
|
||||
<link href="{{ `/feed.atom` | absURL }}" rel="self" />
|
||||
<link href="{{ `/icons/favicon.png` | absURL }}" rel="shortcut icon" />
|
||||
{{ if not .Date.IsZero }}<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
|
||||
<id>{{ .Permalink }}</id>
|
||||
{{ with .Site.Author.name }}
|
||||
<author>
|
||||
<name>{{ . }}</name>
|
||||
{{ with $.Site.Author.email }}<email>{{ . }}</email>{{ end }}
|
||||
<uri>{{ $.Site.Home.Permalink }}</uri>
|
||||
</author>
|
||||
{{ end }}
|
||||
<generator version="{{ hugo.Version }}" uri="https://gohugo.io">Hugo {{ hugo.Version }}</generator>
|
||||
<rights>© 2020-{{ now.Year }} Eryn Wells</rights>
|
||||
{{ range $pages }}{{ .Render "atom_entry" }}{{ end }}
|
||||
</feed>
|
29
layouts/photos/section.atom.atom
Normal file
29
layouts/photos/section.atom.atom
Normal file
|
@ -0,0 +1,29 @@
|
|||
{{- $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 -}}
|
||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>{{ .Site.Title }}</title>
|
||||
<link href="{{ .Permalink }}" />
|
||||
<link href="{{ `/feed.atom` | absURL }}" rel="self" />
|
||||
<link href="{{ `/icons/favicon.png` | absURL }}" rel="shortcut icon" />
|
||||
{{ if not .Date.IsZero }}<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
|
||||
<id>{{ .Permalink }}</id>
|
||||
{{ with .Site.Author.name }}
|
||||
<author>
|
||||
<name>{{ . }}</name>
|
||||
{{ with $.Site.Author.email }}<email>{{ . }}</email>{{ end }}
|
||||
<uri>{{ $.Site.Home.Permalink }}</uri>
|
||||
</author>
|
||||
{{ end }}
|
||||
<generator version="{{ hugo.Version }}" uri="https://gohugo.io">Hugo {{ hugo.Version }}</generator>
|
||||
<rights>© 2020-{{ now.Year }} Eryn Wells</rights>
|
||||
{{ range $pages }}{{ .Render "atom_entry" }}{{ end }}
|
||||
</feed>
|
Loading…
Add table
Add a link
Reference in a new issue