riq0h.jp/themes/qiss/layouts/partials/data/title
2023-08-21 10:07:01 +09:00

19 lines
635 B
Text

{{- $title := ( .Title ) -}}
{{- $siteTitle := ( .Site.Title ) -}}
{{- $sep := ( .Site.Params.SEO.titleSeparator | default "-" ) -}}
{{- $title404 := ( $title ) -}}
{{- if .IsHome -}}
{{ $siteTitle }}
{{- else if eq .Kind "404" -}}
{{ $title404 }} {{ $sep }} {{ $siteTitle }}
{{- else if eq .Kind "taxonomy" -}}
{{- ( ( i18n .Data.Singular 1 ) | default .Data.Singular ) | title -}}
{{- print ": " -}}
{{- $title -}}
{{- print " " $sep " " $siteTitle -}}
{{- else if ( or .IsNode ( eq .Section "page" ) ) -}}
{{ $title }} {{ $sep }} {{ $siteTitle }}
{{- else -}}
{{ $title }} {{ $sep }} {{ $siteTitle }}
{{- end -}}