From 21be0a974b9f581bd9675c9adf6185c7a991d600 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 20 Dec 2018 22:09:02 +0100 Subject: [PATCH] Squashed: fix feed validation errors in template --- themes/geeklab/layouts/_default/list.atom | 28 +++++++++++-------- themes/geeklab/layouts/_default/list.atom.xml | 28 +++++++++++-------- themes/geeklab/layouts/_default/list.html | 11 ++++---- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/themes/geeklab/layouts/_default/list.atom b/themes/geeklab/layouts/_default/list.atom index dae3723..b630465 100644 --- a/themes/geeklab/layouts/_default/list.atom +++ b/themes/geeklab/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/themes/geeklab/layouts/_default/list.atom.xml b/themes/geeklab/layouts/_default/list.atom.xml index dae3723..b630465 100644 --- a/themes/geeklab/layouts/_default/list.atom.xml +++ b/themes/geeklab/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/themes/geeklab/layouts/_default/list.html b/themes/geeklab/layouts/_default/list.html index d7a0fea..13214bb 100644 --- a/themes/geeklab/layouts/_default/list.html +++ b/themes/geeklab/layouts/_default/list.html @@ -23,14 +23,15 @@ - {{ range .Param "authors" }} - {{ $name := . }} - {{ with $.Site.GetPage (printf "/authors/%s" $name | urlize) }} + {{ with .Params.Author }} + {{ $author := index $.Site.Data.authors . }} + + {{ with $.Site.GetPage (printf "/author/%s" $author.name | urlize) }} - {{ end }} + {{ end }} {{ end }} {{ range .Param "categories" }}