Compare commits

..

2 Commits

Author SHA1 Message Date
eb1ea564a7 Merge f66c915d5b into 80fae9f86d 2024-10-19 00:08:06 +02:00
f66c915d5b 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.
2024-02-27 07:15:57 +01:00
2 changed files with 4 additions and 1 deletions

View File

@ -7,7 +7,6 @@
{{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}} {{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}}
{{- $pages = where $pages "Params.excludeSearch" "!=" true -}} {{- $pages = where $pages "Params.excludeSearch" "!=" true -}}
{{- $pages = where $pages "Content" "!=" "" -}}
{{- $output := dict -}} {{- $output := dict -}}

View File

@ -10,6 +10,10 @@
<title> <title>
{{- if .IsHome -}} {{- if .IsHome -}}
{{ .Site.Title -}} {{ .Site.Title -}}
{{ else if eq .Kind "page" -}}
{{ with .Title }}{{ . }} {{ end -}}
{{ $sectionTitle := index .Site.Params.sectionsTitles .Section }}
{{ $sectionTitle | default .Site.Title }}
{{ else -}} {{ else -}}
{{ with .Title }}{{ . }} {{ end -}} {{ with .Title }}{{ . }} {{ end -}}
{{ .Site.Title -}} {{ .Site.Title -}}