diff options
| author | Nicholas Johnson <> | 2026-09-20 00:00:00 +0000 |
|---|---|---|
| committer | Nicholas Johnson <> | 2026-09-20 00:00:00 +0000 |
| commit | a221ae3c6f8da11b12eea4246f5792123c501f221f0e708456c0a5dd24c8d8a0 (patch) | |
| tree | 7125b1e70be7d2829c71e297190eb12d427f540a60472fd258951c9973263e1e | |
| parent | 93831052e8ba9537d47474e1f8dbf04d9eceb9b0dff214ce422fcafe1ffaecac (diff) | |
| download | hugo-theme-journal-a221ae3c6f8da11b12eea4246f5792123c501f221f0e708456c0a5dd24c8d8a0.tar.gz hugo-theme-journal-a221ae3c6f8da11b12eea4246f5792123c501f221f0e708456c0a5dd24c8d8a0.zip | |
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 <noreply@anthropic.com>
| -rw-r--r-- | layouts/_partials/footer.gmi | 2 | ||||
| -rw-r--r-- | layouts/_partials/footer.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/head.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/metadata.gmi | 2 | ||||
| -rw-r--r-- | layouts/_partials/metadata.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/pageinfo.gmi | 2 | ||||
| -rw-r--r-- | layouts/baseof.gmi | 2 | ||||
| -rw-r--r-- | layouts/baseof.html | 2 | ||||
| -rw-r--r-- | layouts/home.gmi | 2 | ||||
| -rw-r--r-- | layouts/home.html | 2 | ||||
| -rw-r--r-- | layouts/single.html | 2 | ||||
| -rw-r--r-- | layouts/taxonomy.gmi | 2 | ||||
| -rw-r--r-- | layouts/taxonomy.html | 2 | ||||
| -rw-r--r-- | layouts/term.gmi | 2 | ||||
| -rw-r--r-- | layouts/term.html | 2 |
15 files changed, 15 insertions, 15 deletions
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 @@ <footer class="footer"> <p class="footer__text">{{ replace $.Site.Copyright "{currentYear}" (now.Format "2006") }}</p> -</footer>
\ No newline at end of file +</footer> 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 @@ <link rel="icon" href="data:,"> {{ end }} <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }}</title> -</head>
\ No newline at end of file +</head> 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 @@ <p>{{ partial "pageinfo.html" . }}<br> {{ emojify ":link:" }} <a class="link link--internal" href="{{ .RelPermalink }}" rel="noreferrer">{{ .Title }}</a></p> </header> -</article>
\ No newline at end of file +</article> 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 @@ </div> {{ partial "footer.html" . }} </body> -</html>
\ No newline at end of file +</html> 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 }} </main> -{{ 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 @@ </div> {{ chomp (.Content) }} </main> -{{ 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 }} </ul> </main> -{{ 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 }} </main> -{{ end }}
\ No newline at end of file +{{ end }} |
