diff --git a/config.yaml b/config.yaml index dd543a3f7f..60a0c26da8 100644 --- a/config.yaml +++ b/config.yaml @@ -1,14 +1,6 @@ baseURL: "https://blog.koehntopp.info" languageCode: "en-us" theme: "hugo-bootstrap-bare" -author: - isotopp: - name: "Kristian Köhntopp" - avatar: "isotopp.jpg" - fedi: "@isotopp@chaos.social" - fediurl: "https://chaos.social/@isotopp" - email: "kris-blog@koehntopp.de" - title: "Die wunderbare Welt von Isotopp" params: @@ -18,6 +10,13 @@ params: URL: "https://github.com/isotopp/isotopp.github.io/edit/main/content" appendFilePath: True Text: "Suggest Changes" + author: + isotopp: + name: "Kristian Köhntopp" + avatar: "isotopp.jpg" + fedi: "@isotopp@chaos.social" + fediurl: "https://chaos.social/@isotopp" + email: "kris-blog@koehntopp.de" frontmatter: date: [":filename", ":default"] diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 24a7d4dff6..eeafa99385 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,40 +1,53 @@ {{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} -{{- $limit := .Site.Config.Services.RSS.Limit -}} -{{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} -{{- end -}} -{{- printf "" | safeHTML }} + {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} + {{- $pages := slice -}} + {{- if or $.IsHome $.IsSection -}} + {{- $pages = $pctx.RegularPages -}} + {{- else -}} + {{- $pages = $pctx.Pages -}} + {{- end -}} + {{- $limit := .Site.Config.Services.RSS.Limit -}} + {{- if ge $limit 1 -}} + {{- $pages = $pages | first $limit -}} + {{- end -}} + {{- printf "" | safeHTML }} {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}} + + {{- $siteAuthor := index .Site.Params.author "isotopp" -}} + + {{ with $siteAuthor.email }} + {{.}}{{ with $siteAuthor.name }} ({{.}}){{end}}{{end}} + + {{ with $siteAuthor.email }} + {{.}}{{ with $siteAuthor.name }} ({{.}}){{end}}{{end}} + + {{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" -}} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} + {{ range $pages }} {{ .Title }} {{ .Permalink }} {{ (.Param "date").Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + + {{- $authorKey := .Param "author" | default "isotopp" -}} + {{- $author := index $.Site.Params.author $authorKey -}} + + {{ with $author.email }}{{.}}{{ with $author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} {{ .Content | html }} {{ end }} - diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 691c1ea1a3..b7e5ac3fdd 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,12 +1,14 @@ {{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} {{ define "main" }} {{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} -{{ $author := (index .Site.Author (string (.Param "author"))) }} +{{ $authorKey := .Param "author" | default "isotopp" }} +{{ $author := index .Site.Params.author $authorKey }} {{ $fedi := $author.fedi }} {{ $fediurl := $author.fediurl }} {{ $name := $author.name }} {{ $avatar := $author.avatar }} {{ $email := $author.email }} +
diff --git a/layouts/index.html b/layouts/index.html index b726a1b92d..e0d332be2f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -16,7 +16,8 @@

{{/* {{ .Content }} */}} {{- range (.Paginate ( where site.RegularPages "Section" "posts" ) ).Pages }} - {{- $author := (index .Site.Author (string (.Param "author"))) }} + {{- $authorKey := .Param "author" | default "isotopp" }} + {{- $author := index .Site.Params.author $authorKey }} {{- $fedi := $author.fedi }} {{- $fediurl := $author.fediurl }} {{- $avatar := $author.avatar }} diff --git a/layouts/partials/head-meta.html b/layouts/partials/head-meta.html index 6dbb14378d..218a901b6f 100644 --- a/layouts/partials/head-meta.html +++ b/layouts/partials/head-meta.html @@ -31,9 +31,11 @@ {{- end }} -{{- $author_fedi := (index .Site.Author (string (.Param "author"))).fedi }} -{{- $author_url := (index .Site.Author (string (.Param "author"))).fediurl }} -{{- $author_email := (index .Site.Author (string (.Param "author"))).email }} +{{- $author_key := .Param "author" | default "isotopp" -}} +{{- $author := index .Site.Params.author $author_key -}} +{{- $author_fedi := $author.fedi -}} +{{- $author_url := $author.fediurl -}} +{{- $author_email := $author.email -}} diff --git a/layouts/taxonomy/mysql.rss.xml b/layouts/taxonomy/mysql.rss.xml index 24a7d4dff6..1762daa87a 100644 --- a/layouts/taxonomy/mysql.rss.xml +++ b/layouts/taxonomy/mysql.rss.xml @@ -1,25 +1,33 @@ {{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} -{{- $limit := .Site.Config.Services.RSS.Limit -}} -{{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} -{{- end -}} -{{- printf "" | safeHTML }} + {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} + {{- $pages := slice -}} + {{- if or $.IsHome $.IsSection -}} + {{- $pages = $pctx.RegularPages -}} + {{- else -}} + {{- $pages = $pctx.Pages -}} + {{- end -}} + {{- $limit := .Site.Config.Services.RSS.Limit -}} + {{- if ge $limit 1 -}} + {{- $pages = $pages | first $limit -}} + {{- end -}} + {{- printf "" | safeHTML }} {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}} + + {{- $siteAuthor := index .Site.Params.author "isotopp" -}} + + {{ with $siteAuthor.email }} + {{.}}{{ with $siteAuthor.name }} ({{.}}){{end}}{{end}} + + {{ with $siteAuthor.email }} + {{.}}{{ with $siteAuthor.name }} ({{.}}){{end}}{{end}} + + {{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" -}} @@ -30,11 +38,12 @@ {{ .Title }} {{ .Permalink }} {{ (.Param "date").Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{- $authorKey := .Param "author" | default "isotopp" -}} + {{- $author := index $.Site.Params.author $authorKey -}} + {{ with $author.email }}{{.}}{{ with $author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Content | html }} {{ end }} -