From f66c915d5b499ba53d8253b99807fe4a4c654e46 Mon Sep 17 00:00:00 2001 From: David Legrand <1110600+davlgd@users.noreply.github.com> Date: Tue, 27 Feb 2024 01:21:18 +0100 Subject: [PATCH] feat: add sectionsTitles param The user can define a per section title in params, used in section pages. If none is defined, the default title is used. --- layouts/partials/head.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ebaab67a..688d1549 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -10,6 +10,10 @@ {{- if .IsHome -}} {{ .Site.Title -}} + {{ else if eq .Kind "page" -}} + {{ with .Title }}{{ . }} – {{ end -}} + {{ $sectionTitle := index .Site.Params.sectionsTitles .Section }} + {{ $sectionTitle | default .Site.Title }} {{ else -}} {{ with .Title }}{{ . }} – {{ end -}} {{ .Site.Title -}}