From 9930b37554ce4ff1453232844d31075737d7d98c Mon Sep 17 00:00:00 2001 From: Hugo Martin Date: Tue, 4 Aug 2020 18:47:20 +0200 Subject: [PATCH] Managing i18n --- layouts/index.html | 4 ++-- layouts/partials/footer.html | 4 ++-- layouts/partials/navigators/navbar.html | 25 ++++++++++++++++++++++--- layouts/partials/sections/about.html | 2 +- layouts/partials/sections/home.html | 14 ++++++++++---- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index d2de694..4d0a585 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -29,9 +29,9 @@ {{- partial "sections/home.html" . -}} - {{ if .Site.Data.sections }} + {{ if (index .Site.Data .Site.Language.Lang).sections }} {{ $background:= "bg-white"}} - {{ range sort .Site.Data.sections "section.weight" }} + {{ range sort (index .Site.Data .Site.Language.Lang).sections "section.weight" }} {{ if .section.enable }}
{{ if .section.template }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index efa3f97..048fa79 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -3,9 +3,9 @@
Navigation
- {{ if .Site.Data.sections }} + {{ if (index .Site.Data .Site.Language.Lang).sections }}
    - {{- range sort .Site.Data.sections "section.weight" }} + {{- range sort (index .Site.Data .Site.Language.Lang).sections "section.weight" }} {{ if and (.section.enable) (.section.showOnNavbar)}}
diff --git a/layouts/partials/sections/about.html b/layouts/partials/sections/about.html index e2888b4..2e6414c 100644 --- a/layouts/partials/sections/about.html +++ b/layouts/partials/sections/about.html @@ -29,7 +29,7 @@
{{ if .resume }} {{ end }}
diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html index 549079d..9d00fc6 100644 --- a/layouts/partials/sections/home.html +++ b/layouts/partials/sections/home.html @@ -23,12 +23,18 @@ - {{ if .Site.Data.sections }} - {{ range first 1 (where (sort .Site.Data.sections "section.weight") ".section.enable" true) }} + {{ if (index .Site.Data .Site.Language.Lang).sections }} + {{ range first 1 (where (sort (index .Site.Data .Site.Language.Lang).sections "section.weight") ".section.enable" true) }} {{ end }} {{ end }}