Move index templates up to layouts/

This commit is contained in:
Eryn Wells 2022-11-05 23:57:52 -07:00
parent 2f3d133dda
commit e15c8488a5
3 changed files with 11 additions and 6 deletions

View file

@ -1,17 +1,20 @@
{{- $pctx := . -}}
{{- $pageContext := . -}}
{{- if .IsHome -}}
{{ $pctx = .Site }}
{{ $pageContext = .Site }}
{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- $pages = $pageContext.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- $pages = $pageContext.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 }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
@ -20,8 +23,10 @@
<description>Recent content on {{ .Site.Title }}</description>
<generator>Hugo {{ hugo.Version }} -- gohugo.io</generator>
{{ with .Site.LanguageCode }}<language>{{ . }}</language>{{ end }}
{{ with .Site.Author }}<managingEditor>{{ .name }} &lt;{{ .email }}&gt;</managingEditor>{{ end }}
{{ with .Site.Author.email }}<webMaster>{{ .name }} &lt;{{ .email }}&gt;</webMaster>{{ end }}
{{ with .Site.Author }}
<managingEditor>{{ .name }} &lt;{{ .email }}&gt;</managingEditor>
<webMaster>{{ .name }} &lt;{{ .email }}&gt;</webMaster>
{{ end }}
{{ with .Site.Copyright }}<copyright>{{ . }}</copyright>{{ end }}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}{{ end }}