aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Johnson <>2026-09-18 00:00:00 +0000
committerNicholas Johnson <>2026-09-19 18:26:10 -0400
commit40d957cfbe3c4791145a35cba1004a6ea30b45ac9e0dbc4eee3577c2d981ee04 (patch)
tree39d0659f213aa715d11ddbe3ea5e39dbd4d1d362332fea306bde2964d031d984
parent61d07d87a9b54cd102699e065a349d5c3fc4a06fbe7a96c255e43aa182c02be7 (diff)
downloadhugo-theme-journal-40d957cfbe3c4791145a35cba1004a6ea30b45ac9e0dbc4eee3577c2d981ee04.tar.gz
hugo-theme-journal-40d957cfbe3c4791145a35cba1004a6ea30b45ac9e0dbc4eee3577c2d981ee04.zip
Ignore blank lines between front matter and entry body
.RawContent keeps the newline that follows the closing front matter delimiter, and only trailing whitespace was being chomped. An entry written with a blank line there, which is what the entry archetype produces, got one more blank line under its pageinfo line in the gemtext than an entry written without one. The same leading newline also hid a heading on the first line from the check that decides whether to add a separating newline, since that pattern is anchored to the start of the content. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
-rw-r--r--layouts/single.gmi2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/single.gmi b/layouts/single.gmi
index 2cee33d..065e057 100644
--- a/layouts/single.gmi
+++ b/layouts/single.gmi
@@ -12,7 +12,7 @@
=> {{ .RelPermalink }} {{ emojify ":link:" }} {{ i18n "downloadAudio" $.Title }}
{{- end }}{{ end }}
-{{ $content := chomp (.RawContent) -}}
+{{ $content := strings.Trim .RawContent "\r\n" -}}
{{ $scratch := newScratch -}}
{{/* if pageinfo exists or content begins with a heading, add an extra newline */ -}}