aboutsummaryrefslogtreecommitdiff
path: root/layouts/index.gmi
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2023-08-25 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2023-08-25 00:00:00 +0000
commit311f143302ed03bfdafca5699f7768ba44161d988364ee2638b9b5f6df8434fd (patch)
tree32de9eaba160fc27248b5b705733265796edcd5a7933413d3223403384a29590 /layouts/index.gmi
parent928a03f3e0b23c3cf131b634e9fd2215578148bc6abb6e834daa9c92862254f5 (diff)
downloadhugo-theme-journal-311f143302ed03bfdafca5699f7768ba44161d988364ee2638b9b5f6df8434fd.tar.gz
hugo-theme-journal-311f143302ed03bfdafca5699f7768ba44161d988364ee2638b9b5f6df8434fd.zip
Fix index.gmi spacing
Index-related variables are made non-optional. This makes the code cleaner.
Diffstat (limited to 'layouts/index.gmi')
-rw-r--r--layouts/index.gmi15
1 files changed, 9 insertions, 6 deletions
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 -}}