From 64d76a174dfa300419774be60d000a1a2dfb3984 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 20 Dec 2018 22:05:01 +0100 Subject: [PATCH] small changes to fix feed validation errors --- layouts/_default/list.atom | 28 +++++++++++++++++----------- layouts/_default/list.atom.xml | 28 +++++++++++++++++----------- layouts/_default/list.html | 5 ++--- 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/layouts/_default/list.atom b/layouts/_default/list.atom index dae3723..b630465 100644 --- a/layouts/_default/list.atom +++ b/layouts/_default/list.atom @@ -1,22 +1,28 @@ - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} - + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ if not .Date.IsZero }} {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }} - {{ .Permalink }}{{ with .Site.Author.name }} - - {{.}}{{ with $.Site.Author.email }} - {{.}}{{end}} - {{end}} + {{ .Permalink }} + {{ with .Site.Params.author }} + {{ $author := index $.Site.Data.authors . }} + + {{ $author.name }} + {{ $author.email }} + + {{end}} Hugo -- gohugo.io {{ range where .Pages "Type" "post" }} {{ `<![CDATA[` | safeHTML }}{{ .Title }}]]> - {{ .Permalink }}{{ with .Site.Params.Author }} - - {{.}} - {{end}} + {{ .Permalink }} + {{ with .Params.Author }} + {{ $author := index $.Site.Data.authors . }} + + {{ $author.name }} + + {{end}} {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ ` diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index dae3723..b630465 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -1,22 +1,28 @@ - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} - + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ if not .Date.IsZero }} {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }} - {{ .Permalink }}{{ with .Site.Author.name }} - - {{.}}{{ with $.Site.Author.email }} - {{.}}{{end}} - {{end}} + {{ .Permalink }} + {{ with .Site.Params.author }} + {{ $author := index $.Site.Data.authors . }} + + {{ $author.name }} + {{ $author.email }} + + {{end}} Hugo -- gohugo.io {{ range where .Pages "Type" "post" }} {{ `<![CDATA[` | safeHTML }}{{ .Title }}]]> - {{ .Permalink }}{{ with .Site.Params.Author }} - - {{.}} - {{end}} + {{ .Permalink }} + {{ with .Params.Author }} + {{ $author := index $.Site.Data.authors . }} + + {{ $author.name }} + + {{end}} {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ ` diff --git a/layouts/_default/list.html b/layouts/_default/list.html index fcf6b57..13214bb 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -24,10 +24,9 @@ {{ with .Params.Author }} - {{ $key := . }} - {{ $author := index $.Site.Data.authors $key }} + {{ $author := index $.Site.Data.authors . }} - {{ with $.Site.GetPage (printf "/authors/%s" $author.name | urlize) }} + {{ with $.Site.GetPage (printf "/author/%s" $author.name | urlize) }}