From 178711418fc11bf05321127aa09c8c718d1695963e2b8023d7e8fbe8cbb1ee44 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Tue, 1 Aug 2023 00:00:00 +0000 Subject: Add multilingual support for index pages --- i18n/en.toml | 3 +++ layouts/index.gmi | 4 ++-- layouts/index.html | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/i18n/en.toml b/i18n/en.toml index 74cc3b0..ddb5f1c 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -22,3 +22,6 @@ [links] other = "Links" + +[navLinks] + other = "Navigation Links" diff --git a/layouts/index.gmi b/layouts/index.gmi index b97ef74..8ace600 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -6,11 +6,11 @@ {{ .Site.Params.indexIntro | safeHTML }} {{- end }} -## Navigation Links +## {{ i18n "navLinks" }} {{ range .Site.Menus.main -}} => {{ .URL }} {{ emojify ":link:" | safeHTML }} {{ .Name | safeHTML }} {{ end }} -## Journal Entries +## {{ 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" . }} diff --git a/layouts/index.html b/layouts/index.html index d29c86a..3161c49 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -6,7 +6,7 @@ {{- if .Site.Params.indexIntro }}

{{ .Site.Params.indexIntro }}

{{- end }} -

Navigation Links

+

{{ i18n "navLinks" }}

-

Journal Entries

+

{{ i18n "journalEntries" }}

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