small changes to fix feed validation errors

This commit is contained in:
Robert Kaussow 2018-12-20 22:05:01 +01:00
parent 5cd3426564
commit 64d76a174d
3 changed files with 36 additions and 25 deletions

View File

@ -1,22 +1,28 @@
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<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 href="{{ .Permalink }}index.xml" rel="self"/> <link href="{{ .Permalink }}feed.atom.xml" rel="self"/>
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }} <link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }} <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
<id>{{ .Permalink }}</id>{{ with .Site.Author.name }} <id>{{ .Permalink }}</id>
<author> {{ with .Site.Params.author }}
<name>{{.}}</name>{{ with $.Site.Author.email }} {{ $author := index $.Site.Data.authors . }}
<email>{{.}}</email>{{end}} <author>
</author>{{end}} <name>{{ $author.name }}</name>
<email>{{ $author.email }}</email>
</author>
{{end}}
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
{{ range where .Pages "Type" "post" }} {{ range where .Pages "Type" "post" }}
<entry> <entry>
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title> {{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
<link href="{{ .Permalink }}"/> <link href="{{ .Permalink }}"/>
<id>{{ .Permalink }}</id>{{ with .Site.Params.Author }} <id>{{ .Permalink }}</id>
<author> {{ with .Params.Author }}
<name>{{.}}</name> {{ $author := index $.Site.Data.authors . }}
</author>{{end}} <author>
<name>{{ $author.name }}</name>
</author>
{{end}}
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published> <published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> <updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content> {{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>

View File

@ -1,22 +1,28 @@
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<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 href="{{ .Permalink }}index.xml" rel="self"/> <link href="{{ .Permalink }}feed.atom.xml" rel="self"/>
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }} <link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }} <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
<id>{{ .Permalink }}</id>{{ with .Site.Author.name }} <id>{{ .Permalink }}</id>
<author> {{ with .Site.Params.author }}
<name>{{.}}</name>{{ with $.Site.Author.email }} {{ $author := index $.Site.Data.authors . }}
<email>{{.}}</email>{{end}} <author>
</author>{{end}} <name>{{ $author.name }}</name>
<email>{{ $author.email }}</email>
</author>
{{end}}
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
{{ range where .Pages "Type" "post" }} {{ range where .Pages "Type" "post" }}
<entry> <entry>
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title> {{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
<link href="{{ .Permalink }}"/> <link href="{{ .Permalink }}"/>
<id>{{ .Permalink }}</id>{{ with .Site.Params.Author }} <id>{{ .Permalink }}</id>
<author> {{ with .Params.Author }}
<name>{{.}}</name> {{ $author := index $.Site.Data.authors . }}
</author>{{end}} <author>
<name>{{ $author.name }}</name>
</author>
{{end}}
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published> <published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> <updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content> {{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>

View File

@ -24,10 +24,9 @@
</span> </span>
{{ with .Params.Author }} {{ with .Params.Author }}
{{ $key := . }} {{ $author := index $.Site.Data.authors . }}
{{ $author := index $.Site.Data.authors $key }}
{{ with $.Site.GetPage (printf "/authors/%s" $author.name | urlize) }} {{ with $.Site.GetPage (printf "/author/%s" $author.name | urlize) }}
<span class="post-footer__button"> <span class="post-footer__button">
<i class="fas fa-user post-footer__icon"></i> <i class="fas fa-user post-footer__icon"></i>
<a class="post-footer__link" href="{{ .RelPermalink }}" title="Alle Artikel des Autors">{{ $author.name }}</a> <a class="post-footer__link" href="{{ .RelPermalink }}" title="Alle Artikel des Autors">{{ $author.name }}</a>