diff options
| author | Nicholas Johnson <> | 2026-09-06 00:00:00 +0000 |
|---|---|---|
| committer | Nicholas Johnson <> | 2026-09-06 00:00:00 +0000 |
| commit | f017963dd7f40371bcfe6b75446e8c69d651b1759ea194b11ec22aa1c0d70e05 (patch) | |
| tree | 4071aac56058494cee0441c39a82530fcb8c2267973401cc8013065729d2b5d6 | |
| parent | 151b5149973594233512d27dba434184665e398827f7da361a644501a16b1e58 (diff) | |
| download | hugo-theme-journal-f017963dd7f40371bcfe6b75446e8c69d651b1759ea194b11ec22aa1c0d70e05.tar.gz hugo-theme-journal-f017963dd7f40371bcfe6b75446e8c69d651b1759ea194b11ec22aa1c0d70e05.zip | |
Move pageinfo below heading for capsule
| -rw-r--r-- | layouts/single.gmi | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/layouts/single.gmi b/layouts/single.gmi index eb04578..26c8cee 100644 --- a/layouts/single.gmi +++ b/layouts/single.gmi @@ -1,20 +1,18 @@ {{ define "main" -}} {{ $emoji := cond (.Page.Params.showlinkemoji | default true) (emojify ":link: ") "" -}} -=> {{ .Site.Home.RelPermalink | strings.TrimSuffix "index.gmi" }} {{ emojify ":link:" }} {{ i18n "returnHome" -}} - -{{ if (.Page.Params.pageinfo | default true) }} - -{{ partial "pageinfo.gmi" . -}} -{{ end }} +=> {{ .Site.Home.RelPermalink | strings.TrimSuffix "index.gmi" }} {{ emojify ":link:" }} {{ i18n "returnHome" }} # {{ .Title }} +{{- if (.Page.Params.pageinfo | default true) }} +{{ partial "pageinfo.gmi" . }} +{{- end }} {{ $content := chomp (.RawContent) -}} {{ $scratch := newScratch -}} -{{/* if content begins with a heading, add an extra newline */ -}} -{{ if (findRE `^#{1,6} ` $content 1) }} +{{/* if pageinfo exists or content begins with a heading, add an extra newline */ -}} +{{ if (or (.Page.Params.pageinfo | default true) (findRE `^#{1,6} ` $content 1)) }} {{ end -}} {{/* split text into chunks, with each chunk containing 3 parts: above, within, and below preformatted text */ -}} |
