Files
docs/layouts/partials/utils/title.html
T
2023-08-22 09:41:02 +02:00

13 lines
325 B
HTML

{{ $title := "" }}
{{ if .LinkTitle }}
{{ $title = .LinkTitle }}
{{ else }}
{{ $title = index (findRE `# .*` .RawContent) 0 | strings.TrimLeft "# " }}
{{ if not $title }}
{{ with .File }}
{{ $title = strings.ReplaceRE "[-_]" " " .TranslationBaseName }}
{{ end }}
{{ end }}
{{ end }}
{{ return $title }}