From a221ae3c6f8da11b12eea4246f5792123c501f221f0e708456c0a5dd24c8d8a0 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson <> Date: Sun, 20 Sep 2026 00:00:00 +0000 Subject: End every template file with a newline Fifteen templates ended without a final newline, so they were not text files by the POSIX definition: tools that read whole lines, including sed, wc -l, read and shells' command substitution, drop or mangle the last line, and diffs of them carry a "\ No newline at end of file" marker that hides which side changed. Add the newline. The gemtext output may not change, so the four templates whose last action is emitted verbatim into a capsule page trim it away again with "-}}". The templates that end by closing a define block need no marker, since the newline then falls outside the block and is never executed, as section.gmi and single.gmi already showed. The capsule builds byte-identical gemtext and the feeds are unchanged. Web pages gain the trailing newline their templates now have, which ends the generated HTML with an EOL too. Co-Authored-By: Claude Opus 5 --- layouts/_partials/footer.gmi | 2 +- layouts/_partials/footer.html | 2 +- layouts/_partials/head.html | 2 +- layouts/_partials/metadata.gmi | 2 +- layouts/_partials/metadata.html | 2 +- layouts/_partials/pageinfo.gmi | 2 +- layouts/baseof.gmi | 2 +- layouts/baseof.html | 2 +- layouts/home.gmi | 2 +- layouts/home.html | 2 +- layouts/single.html | 2 +- layouts/taxonomy.gmi | 2 +- layouts/taxonomy.html | 2 +- layouts/term.gmi | 2 +- layouts/term.html | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) (limited to 'layouts') diff --git a/layouts/_partials/footer.gmi b/layouts/_partials/footer.gmi index 06b0678..8f036f2 100644 --- a/layouts/_partials/footer.gmi +++ b/layouts/_partials/footer.gmi @@ -1 +1 @@ -{{ replace $.Site.Copyright "{currentYear}" (now.Format "2006") }} \ No newline at end of file +{{ replace $.Site.Copyright "{currentYear}" (now.Format "2006") -}} diff --git a/layouts/_partials/footer.html b/layouts/_partials/footer.html index 5f8ffc6..b445ae4 100644 --- a/layouts/_partials/footer.html +++ b/layouts/_partials/footer.html @@ -1,3 +1,3 @@ \ No newline at end of file + diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html index 8487d06..d6b1e5e 100644 --- a/layouts/_partials/head.html +++ b/layouts/_partials/head.html @@ -22,4 +22,4 @@ {{ end }} {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }} - \ No newline at end of file + diff --git a/layouts/_partials/metadata.gmi b/layouts/_partials/metadata.gmi index 48d3db4..13ad1c7 100644 --- a/layouts/_partials/metadata.gmi +++ b/layouts/_partials/metadata.gmi @@ -1,2 +1,2 @@ {{ partial "pageinfo.gmi" . }} -=> {{ .RelPermalink | strings.TrimSuffix "index.gmi" }} {{ emojify ":link:" }} {{ .Title }} \ No newline at end of file +=> {{ .RelPermalink | strings.TrimSuffix "index.gmi" }} {{ emojify ":link:" }} {{ .Title -}} diff --git a/layouts/_partials/metadata.html b/layouts/_partials/metadata.html index ed091b8..758b001 100644 --- a/layouts/_partials/metadata.html +++ b/layouts/_partials/metadata.html @@ -3,4 +3,4 @@

{{ partial "pageinfo.html" . }}
{{ emojify ":link:" }} {{ .Title }}

- \ No newline at end of file + diff --git a/layouts/_partials/pageinfo.gmi b/layouts/_partials/pageinfo.gmi index f68fa2f..8a5d33e 100644 --- a/layouts/_partials/pageinfo.gmi +++ b/layouts/_partials/pageinfo.gmi @@ -19,4 +19,4 @@ {{ $nonBreakingAudioAvailable = replace $nonBreakingAudioAvailable " " " " -}} {{ $nonBreakingAudioAvailable = replace $nonBreakingAudioAvailable "-" "‑" -}} -{{ emojify ":calendar:" }} {{ $nonBreakingPublishDate }} {{ emojify ":stopwatch:" }} {{ $nonBreakingReadingTime }}{{ if where .Resources "MediaType.MainType" "audio" }} {{ emojify ":headphones:" }} {{ $nonBreakingAudioAvailable }}{{ end }}{{ if $nonBreakingTags }} {{ emojify ":label:" }} {{ end }}{{ range $key, $val := $nonBreakingTags }}{{ if $key }}, {{ end }}{{ $val }}{{ end }} \ No newline at end of file +{{ emojify ":calendar:" }} {{ $nonBreakingPublishDate }} {{ emojify ":stopwatch:" }} {{ $nonBreakingReadingTime }}{{ if where .Resources "MediaType.MainType" "audio" }} {{ emojify ":headphones:" }} {{ $nonBreakingAudioAvailable }}{{ end }}{{ if $nonBreakingTags }} {{ emojify ":label:" }} {{ end }}{{ range $key, $val := $nonBreakingTags }}{{ if $key }}, {{ end }}{{ $val }}{{ end -}} diff --git a/layouts/baseof.gmi b/layouts/baseof.gmi index afb7941..1596a5b 100644 --- a/layouts/baseof.gmi +++ b/layouts/baseof.gmi @@ -5,4 +5,4 @@ {{ block "main" . }}{{ end }} -{{ partial "footer.gmi" . }} \ No newline at end of file +{{ partial "footer.gmi" . -}} diff --git a/layouts/baseof.html b/layouts/baseof.html index fbe1fa1..7049343 100644 --- a/layouts/baseof.html +++ b/layouts/baseof.html @@ -8,4 +8,4 @@ {{ partial "footer.html" . }} - \ No newline at end of file + diff --git a/layouts/home.gmi b/layouts/home.gmi index 3668e45..0a056f7 100644 --- a/layouts/home.gmi +++ b/layouts/home.gmi @@ -24,4 +24,4 @@ {{ end -}} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/home.html b/layouts/home.html index bdaa6af..b3dcdd0 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -19,4 +19,4 @@ {{ end }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/single.html b/layouts/single.html index ead0c52..973fbef 100644 --- a/layouts/single.html +++ b/layouts/single.html @@ -20,4 +20,4 @@ {{ chomp (.Content) }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/taxonomy.gmi b/layouts/taxonomy.gmi index 9c2a9f0..8b132be 100644 --- a/layouts/taxonomy.gmi +++ b/layouts/taxonomy.gmi @@ -14,4 +14,4 @@ {{ range .Data.Pages }} => {{ .RelPermalink | strings.TrimSuffix "index.gmi" }} {{ emojify ":link:" }} {{ .Title -}} {{ end -}} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/taxonomy.html b/layouts/taxonomy.html index c56a7d5..a5f61a3 100644 --- a/layouts/taxonomy.html +++ b/layouts/taxonomy.html @@ -13,4 +13,4 @@ {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/term.gmi b/layouts/term.gmi index 5d7f7b1..7d8a0bd 100644 --- a/layouts/term.gmi +++ b/layouts/term.gmi @@ -16,4 +16,4 @@ {{ partial "metadata.gmi" . -}} {{ end -}} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/term.html b/layouts/term.html index 85622f4..7218c7b 100644 --- a/layouts/term.html +++ b/layouts/term.html @@ -11,4 +11,4 @@ {{ partial "metadata.html" . }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} -- cgit v1.2.3