mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-12-04 21:23:07 +00:00
12 lines
325 B
Go Template
12 lines
325 B
Go Template
|
{{- $title := "" }}
|
||
|
{{- with . }}
|
||
|
{{- $pagetitle := "" }}
|
||
|
{{- with .Page }}
|
||
|
{{- $pagetitle = or .LinkTitle .Title }}
|
||
|
{{- end }}
|
||
|
{{- $title = or .Title (.Name | safeHTML) }}
|
||
|
{{- if and (eq $pagetitle .Title) (ne .Name .Title) }}
|
||
|
{{- $title = (.Name | safeHTML) }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|
||
|
{{- return $title }}
|