From 812b14ad744a01ac2e33139645035f1fb7a8a862 Mon Sep 17 00:00:00 2001 From: zzossig Date: Tue, 18 Feb 2020 09:56:46 +0900 Subject: [PATCH] rss feed fix some mistakes --- layouts/_default/rss.xml | 30 +++++++++++++++++------------- layouts/_default/taxonomy.xml | 22 ++++++++++++---------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index d7d0708..64ec7a9 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,9 +1,10 @@ {{ printf "" | safeHTML }} - + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} @@ -15,8 +16,7 @@ {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}{{ with .Site.Params.updatePeriod }} {{.}}{{end}}{{ with .Site.Params.updateFrequency }} - {{.}}{{end}}{{ with .Site.Params.myname }} - {{.}}{{end}} + {{.}}{{end}} {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} @@ -34,12 +34,14 @@ {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} + {{ with .Params.Lastmod }}{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{end}} {{ .Permalink }} {{ .Summary | html }} {{ if .Site.Params.fullContents }}{{ .Content | html }}{{end}} - {{ with $.Params.image }}featured image{{end}} - {{ with $.Params.featured_image }}featured image{{end}} - {{ with $.Params.meta_image }}meta image{{end}} + {{ if .Params.author }}{{ .Params.author }}{{ else if .Site.Params.myname }}{{ .Site.Params.myname }}{{end}} + {{ if .Params.image }}featured image{{end}} + {{ if .Params.featured_image }}featured image{{end}} + {{ if .Params.meta_image }}meta image{{end}} {{ with .Params.tags }} {{ range . }} {{ with . }} @@ -72,12 +74,14 @@ {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} + {{ with .Params.Lastmod }}{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{end}} {{ .Permalink }} {{ .Summary | html }} {{ if .Site.Params.fullContents }}{{ .Content | html }}{{end}} - {{ with $.Params.image }}featured image{{end}} - {{ with $.Params.featured_image }}featured image{{end}} - {{ with $.Params.meta_image }}meta image{{end}} + {{ if .Params.author }}{{ .Params.author }}{{ else if .Site.Params.myname }}{{ .Site.Params.myname }}{{end}} + {{ if .Params.image }}featured image{{end}} + {{ if .Params.featured_image }}featured image{{end}} + {{ if .Params.meta_image }}meta image{{end}} {{ with .Params.tags }} {{ range . }} {{ with . }} diff --git a/layouts/_default/taxonomy.xml b/layouts/_default/taxonomy.xml index 0c80a14..dd107ad 100644 --- a/layouts/_default/taxonomy.xml +++ b/layouts/_default/taxonomy.xml @@ -1,9 +1,10 @@ {{ printf "" | safeHTML }} - + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} @@ -15,8 +16,7 @@ {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}{{ with .Site.Params.updatePeriod }} {{.}}{{end}}{{ with .Site.Params.updateFrequency }} - {{.}}{{end}}{{ with .Site.Params.myname }} - {{.}}{{end}} + {{.}}{{end}} {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} @@ -27,12 +27,14 @@ {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} + {{ with .Params.Lastmod }}{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{end}} {{ .Permalink }} {{ .Summary | html }} {{ if .Site.Params.fullContents }}{{end}} - {{ with $.Params.image }}featured image{{end}} - {{ with $.Params.featured_image }}featured image{{end}} - {{ with $.Params.meta_image }}meta image{{end}} + {{ if .Params.author }}{{ .Params.author }}{{ else if .Site.Params.myname }}{{ .Site.Params.myname }}{{end}} + {{ if .Params.image }}featured image{{end}} + {{ if .Params.featured_image }}featured image{{end}} + {{ if .Params.meta_image }}meta image{{end}} {{ with .Params.tags }} {{ range . }} {{ with . }}