working draft of thoughts
This commit is contained in:
10
layouts/_partials/thought_text.html
Normal file
10
layouts/_partials/thought_text.html
Normal 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 -}}
|
||||
Reference in New Issue
Block a user