replace .Site with site & fix whitespace

This commit is contained in:
Aditya Telange 2023-11-04 15:36:08 +05:30
parent ff7443b17f
commit f51ad49819

View file

@ -31,23 +31,23 @@
{{- end }} {{- end }}
{{- $pctx := . }} {{- $pctx := . }}
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} {{- if .IsHome }}{{ $pctx = site }}{{ end }}
{{- $pages := slice }} {{- $pages := slice }}
{{- if or $.IsHome $.IsSection }} {{- if or $.IsHome $.IsSection }}
{{- $pages = $pctx.RegularPages }} {{- $pages = $pctx.RegularPages }}
{{- else }} {{- else }}
{{- $pages = $pctx.Pages }} {{- $pages = $pctx.Pages }}
{{- end }} {{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit }} {{- $limit := site.Config.Services.RSS.Limit }}
{{- if ge $limit 1 }} {{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }} {{- $pages = $pages | first $limit }}
{{- end }} {{- end }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> <title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description> <description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }}</description>
{{- with site.Params.images }} {{- with site.Params.images }}
<image> <image>
<title>{{ site.Title }}</title> <title>{{ site.Title }}</title>
@ -58,7 +58,7 @@
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
<language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }} <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }} <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }} <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with site.Copyright }}
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }} <copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" }} {{- with .OutputFormats.Get "RSS" }}
@ -78,6 +78,6 @@
{{- end }} {{- end }}
</item> </item>
{{- end }} {{- end }}
{{ end }} {{- end }}
</channel> </channel>
</rss> </rss>