mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +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 }}
|