diff --git a/layouts/_default/section.atom b/layouts/_default/section.atom index 632e1a2..096789d 100644 --- a/layouts/_default/section.atom +++ b/layouts/_default/section.atom @@ -1,7 +1,6 @@ -{{- $page := . -}} -{{- $pages := $page.RegularPages -}} -{{- $limit := $.Site.Config.Services.RSS.Limit -}} +{{- $pages := .RegularPagesRecursive.ByDate.Reverse -}} +{{- $limit := int $.Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} -{{ partial "feeds/atom/base.xml" (dict "context" $page "pages" $pages "limit" $limit) }} +{{ partial "feeds/atom/base.xml" (dict "context" . "pages" $pages "limit" $limit) }} diff --git a/layouts/_default/section.xml b/layouts/_default/section.xml new file mode 120000 index 0000000..caf0a0c --- /dev/null +++ b/layouts/_default/section.xml @@ -0,0 +1 @@ +section.atom \ No newline at end of file diff --git a/layouts/index.atom b/layouts/index.atom index c231f3e..129310b 100644 --- a/layouts/index.atom +++ b/layouts/index.atom @@ -1,7 +1,6 @@ -{{- $pages := where .Site.RegularPages "Draft" "eq" false -}} -{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- $pages := .Site.RegularPages.ByDate.Reverse -}} +{{- $limit := int $.Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} - {{ partial "feeds/atom/base.xml" (dict "context" . "pages" $pages) }} diff --git a/layouts/index.xml b/layouts/index.xml new file mode 120000 index 0000000..b8f446d --- /dev/null +++ b/layouts/index.xml @@ -0,0 +1 @@ +index.atom \ No newline at end of file diff --git a/layouts/partials/feeds/atom/base.xml b/layouts/partials/feeds/atom/base.xml index e965cc3..7185221 100644 --- a/layouts/partials/feeds/atom/base.xml +++ b/layouts/partials/feeds/atom/base.xml @@ -4,23 +4,26 @@ {{ printf "" | safeHTML }} {{ $context.Site.Title }} - - + {{ with $context.OutputFormats.Get "Atom" -}} + + {{- end }} - {{ with $context.Date }} + {{ with $context.Date -}} {{ . | time.Format "2006-01-02T15:04:05-07:00" | safeHTML }} - {{ end }} + {{- end -}} {{ $context.Permalink }} - {{ with $context.Site.Author }} + {{ with $context.Site.Params.Author -}} {{ with .name }}{{ . }}{{ end }} {{ with .email }}{{ . }}{{ end }} {{ $context.Site.Home.Permalink }} - {{ end }} + {{- end }} Hugo {{ hugo.Version }} © 2020-{{ now.Year }} Eryn Wells - {{ range $pages }} - {{ .Render "atom_entry" }} - {{ end }} + {{ range $pages -}} + {{- if and (not .Date.IsZero) (or hugo.IsDevelopment (not .Draft)) -}} + {{ .Render "atom_entry" }} + {{- end -}} + {{- end -}}