11 lines
392 B
HTML
11 lines
392 B
HTML
{{- /* A thought is the first H1 in the page body. The front matter title is only a formality. */ -}}
|
|
{{- $matches := findRE `<h1[^>]*>[\s\S]*?</h1>` .Content 1 -}}
|
|
{{- $text := "" -}}
|
|
{{- with $matches -}}
|
|
{{- $text = index . 0 | plainify | htmlUnescape | strings.TrimSpace -}}
|
|
{{- end -}}
|
|
{{- if not $text -}}
|
|
{{- $text = .Plain | strings.TrimSpace -}}
|
|
{{- end -}}
|
|
{{- return $text -}}
|