From 6e9cc2a184805f6b3de073e4e96986c1f7d6e427c7baae9220313fde34b7dc0f Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 25 Aug 2023 00:00:00 +0000 Subject: Correctly handle absent navlinks --- layouts/index.gmi | 8 ++++++-- layouts/index.html | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'layouts') diff --git a/layouts/index.gmi b/layouts/index.gmi index 1b66945..a15154c 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -3,13 +3,17 @@ {{ .Site.Params.indexIntro | safeHTML }} +{{- if .Site.Menus.main }} + ## {{ i18n "navLinks" }} +{{ range .Site.Menus.main }} +=> {{ .URL }} {{ emojify ":link:" | safeHTML }} {{ .Name | safeHTML -}} +{{ end -}} -{{ range .Site.Menus.main -}} -=> {{ .URL }} {{ emojify ":link:" | safeHTML }} {{ .Name | safeHTML }} {{ end }} + ## {{ i18n "journalEntries" -}} {{ range (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }} diff --git a/layouts/index.html b/layouts/index.html index d49b710..f2e757c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,6 +2,7 @@

{{ .Site.Params.indexTitle }}

{{ .Site.Params.indexIntro }}

+ {{ if .Site.Menus.main -}}

{{ i18n "navLinks" }}

+ {{ end -}}

{{ i18n "journalEntries" }}

{{ range (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} {{ partial "metadata.html" . }} -- cgit v1.2.3