diff options
| author | tdro <tdro@noreply.example.com> | 2025-01-16 00:00:00 +0000 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2025-01-16 00:00:00 +0000 |
| commit | 1936c2abd57bb354f228dedbe3d3e4fdec850106 (patch) | |
| tree | 272439590bd226f1a7d20497b0b88b4a29f67bd8 | |
| parent | d7bea7cad51cdb5574541ff87c47d7e7dad98cc4 (diff) | |
| download | canory-1936c2abd57bb354f228dedbe3d3e4fdec850106.tar.gz canory-1936c2abd57bb354f228dedbe3d3e4fdec850106.tar.bz2 canory-1936c2abd57bb354f228dedbe3d3e4fdec850106.zip | |
themes/default/layouts/partials/head-title: Merge and improve
| -rw-r--r-- | themes/default/layouts/partials/head-title.html | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/themes/default/layouts/partials/head-title.html b/themes/default/layouts/partials/head-title.html index c7da2e8..e01fce9 100644 --- a/themes/default/layouts/partials/head-title.html +++ b/themes/default/layouts/partials/head-title.html @@ -1,23 +1,29 @@ +{{- $title := partial "meta-title.html" . -}} {{- $author := index .Site.Data.authors .Section -}} +{{- $dash := print " " ("—" | htmlUnescape) " " -}} -{{- if not (eq .Title $.Site.Title) -}} - {{- with $title := or .Title .Summary -}} - {{- with (eq $.Page.Kind "term") -}} - {{- $title = print "#" (lower $title) -}} - {{- end -}} - {{ $title }} — - {{ end }} +{{- with not (eq .Title $.Site.Title) -}} + {{- $title = print $title $dash -}} + {{- if (eq $.Page.Kind "term") -}} + {{- $title = print "#" (lower $title) -}} + {{- end -}} {{- end -}} -{{- with $title := $.Site.Title -}} - {{- if (in (slice - "home" - "taxonomy" - "term" - ) $.Page.Kind) - -}} - {{ $title }} - {{- else -}} - {{ $author.title }} +{{- with $site := $.Site.Title -}} + {{- if (in (slice "taxonomy" "term") $.Page.Kind) -}} + {{- $title = print $title $site -}} + {{- end -}} + + {{- if (in (slice "home") $.Page.Kind) -}} + {{- $title = print $site -}} + {{- end -}} + + {{- if (in (slice "section") $.Page.Kind) -}} + {{- $title = print $author.title -}} + {{- with $section := strings.TrimLeft "section." $.Page.Layout | title -}} + {{- $title = print $section $dash $author.title -}} + {{- end -}} {{- end -}} {{- end -}} + +{{- $title -}} |
