working draft of thoughts

This commit is contained in:
2026-11-05 11:58:07 +00:00
parent 5aa828852a
commit e60475cc93
13 changed files with 575 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
{{- /* 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 -}}