diff --git a/config.toml b/config.toml index 12a8b6b..e35bfb1 100755 --- a/config.toml +++ b/config.toml @@ -17,7 +17,6 @@ summaryLength = 50 [params] avatar = "profile.png" - author = "Max Mehl" description = "Open Source expert with background in tech and policy. Focused on strategy, governance, and software supply chains. Building sustainable digital environments." keywords = "open source, free software, Deutsche Bahn, DB Systel, FSFE, management, campaign, communication, strategy, konstanz, berlin, munster, IT service, politics, administration, scouts, founder" @@ -25,6 +24,9 @@ summaryLength = 50 custom_css = ["comments/mastodon-comments.css"] custom_js = ["comments/getcomments.js"] +[params.author] + name = "Max Mehl" + [params.social] Github = "mxmehl" Git = "https://src.mehl.mx/mxmehl" diff --git a/themes/hugo-sustain/layouts/_default/rss.xml b/themes/hugo-sustain/layouts/_default/rss.xml index ef7a711..9ac9c4c 100644 --- a/themes/hugo-sustain/layouts/_default/rss.xml +++ b/themes/hugo-sustain/layouts/_default/rss.xml @@ -1,28 +1,70 @@ -{{ printf "" | safeHTML }} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- end }} + +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} + +{{- $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 eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ .Site.Title }}{{ with .Title }} ({{.|humanize}}){{ end }}{{ 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}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{ end }} - {{ range .Pages }} + Hugo + {{ site.Language.LanguageCode }} + {{- with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }} + {{- end }} + {{- with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }} + {{- end }} + {{- with .Site.Copyright }} + {{ . }} + {{- end }} + {{- if not .Date.IsZero }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{- with $authorEmail }} + {{.}}{{ with $authorName }} ({{.}}){{end}} + {{- end }} {{ .Permalink }} - {{ .Summary | html }} - {{ .Content | html }} + {{ .Summary | transform.XMLEscape | safeHTML }} + {{ .Content | transform.XMLEscape | safeHTML }} - {{ end }} + {{- end }} diff --git a/themes/hugo-sustain/layouts/partials/head.html b/themes/hugo-sustain/layouts/partials/head.html index 95fa156..1deb62c 100644 --- a/themes/hugo-sustain/layouts/partials/head.html +++ b/themes/hugo-sustain/layouts/partials/head.html @@ -15,7 +15,7 @@ - + {{ with .Site.Params.description }}{{ end }} {{ with .Site.Params.keywords }}{{ end }}