From 311f143302ed03bfdafca5699f7768ba44161d988364ee2638b9b5f6df8434fd Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 25 Aug 2023 00:00:00 +0000 Subject: Fix index.gmi spacing Index-related variables are made non-optional. This makes the code cleaner. --- layouts/index.gmi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'layouts/index.gmi') diff --git a/layouts/index.gmi b/layouts/index.gmi index 1f1d5f1..8fa1593 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -1,20 +1,23 @@ {{ define "main" -}} -{{ if .Site.Params.indexTitle }} -# {{ .Site.Params.indexTitle | safeHTML -}} -{{ end -}} -{{ if .Site.Params.indexIntro }} -{{ .Site.Params.indexIntro | safeHTML -}} +# {{ .Site.Params.indexTitle | safeHTML }} + +{{ .Site.Params.indexIntro | safeHTML }} + -{{ end }} ## {{ i18n "navLinks" }} + {{ range .Site.Menus.main -}} => {{ .URL }} {{ emojify ":link:" | safeHTML }} {{ .Name | safeHTML }} {{ end }} + ## {{ i18n "journalEntries" }} + {{ $entriesMinusOne := sub (len (where .Site.RegularPages.ByTitle "Section" "entry")) 1 -}} {{ range first $entriesMinusOne (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} {{ partial "metadata.gmi" . }} + {{ end -}} + {{ range last 1 (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} {{ partial "metadata.gmi" . -}} {{ end -}} -- cgit v1.2.3