hugo-theme-relearn/layouts/partials/menutitle.gotmpl
2024-10-22 19:35:28 +02:00

12 lines
No EOL
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 }}