commit f1860b371aa2af247c840f920e7f18eb1e9a3df4
parent a84f11f8c1670d943581ff23613485777d4f43ce
Author: Lou Woell <lou.woell@posteo.de>
Date:   Sat, 13 Dec 2025 18:47:42 +0100

partial ld_schema: generalize

Diffstat:
Mlayouts/_partials/ld_schema.html | 70+++++++++++++++++++++++++++++++++++++---------------------------------
1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/layouts/_partials/ld_schema.html b/layouts/_partials/ld_schema.html @@ -1,35 +1,39 @@ -{{- if eq .Type "posts" }} - <script type="application/ld+json"> - { - "@context": "https://schema.org", - "@type": "BlogPosting", - "headline": "{{ .Params.title }}", - "datePublished": "{{ .Params.date }}", - "dateModified": "{{ .Lastmod }}", - "description": "{{ .Params.description }}", - "author": { - "@type": "Person", - "name": "lou woell", - "alternateName": "lou.", - "url": "https://repetitions.de" - }, - "image": { - "@type": "ImageObject", - "url": {{ with (.Params.cover | .Resources.GetMatch) -}} - "{{ .RelPermalink | absURL }}" - {{- else -}} - {{- if .Site.Params.favicon -}} - "{{ $.Site.Params.favicon | absURL }}" - {{- else -}} - "{{ printf "img/theme-colors/%s.png" .Site.Params.ThemeColor | absURL }}" - {{- end -}} - {{- end }} - }, - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "{{ .Permalink }}" - } +<script type="application/ld+json"> + { + "@context": "https://schema.org", + {{ if eq .Type "posts" }} + "@type": "BlogPosting", + "headline": "{{ .Params.title }}", + "datePublished": "{{ .Params.date }}", + "description": "{{ .Params.description }}", + {{- else if eq .Type "about" -}} + "@type": "AboutPage", + {{- else -}} + "@type": "WebPage", + {{- end }} + "author": { + "@type": "Person", + "name": "lou woell", + "alternateName": "lou.", + "url": "https://repetitions.de" + }, + "dateModified": "{{ .Lastmod }}", + "image": { + "@type": "ImageObject", + "url": {{ with (.Params.cover | .Resources.GetMatch) -}} + "{{ .RelPermalink | absURL }}" + {{- else -}} + {{- if .Site.Params.favicon -}} + "{{ $.Site.Params.favicon | absURL }}" + {{- else -}} + "{{ printf "img/theme-colors/%s.png" .Site.Params.ThemeColor | absURL }}" + {{- end -}} + {{- end }} + }, + "mainEntityOfPage": { + "@type": "WebPage", + "@id": "{{ .Permalink }}" } - </script> -{{- end -}} + } +</script>