From b31a718136bfc81509533ecc09a3e7f3c27a4a6b Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 16 Aug 2025 22:12:15 +0200 Subject: fix: set rel=alternate for individual pages --- layouts/partials/head.html | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'layouts/partials/head.html') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e437156..55a2077 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,9 +17,22 @@ {{ end }} -{{ with .OutputFormats.Get "rss" -}} -{{ printf `` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} -{{ end }} +{{- define "outputFormats" -}} + {{- range .OutputFormats }} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{- end }} +{{- end -}} + +{{ if .IsHome -}} + {{ with .Site.GetPage (site.Params.homeCollection | default "") -}} + {{ template "outputFormats" . }} + {{ end }} +{{ else -}} + {{ template "outputFormats" . }} + {{ with .Parent -}} + {{ template "outputFormats" . }} + {{- end }} +{{- end }} {{- if .IsHome -}} -- cgit v1.2.3