From d5a3f361870acbfe2ed6a55e1fde781018f643f8 Mon Sep 17 00:00:00 2001 From: "max.mehl" Date: Tue, 21 Mar 2017 19:37:45 +0100 Subject: [PATCH] dynamic language detection for selector and rel-alternatives in header --- config.toml | 5 ++++- layouts/partials/head.html | 6 +++++- layouts/partials/language.html | 6 ++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index 98eeb47..960e0da 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,4 @@ baseurl = "http://pmpc.mehl.mx/" -languageCode = "en-us" title = "Public Money, Public Code" theme = "hugo-creative-theme" DefaultContentLanguage = "en" @@ -7,6 +6,8 @@ DefaultContentLanguage = "en" [params] author = "Free Software Foundation Europe (FSFE)" description = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software" + languageCode = "en-us" + languageName = "English" favicon = "favicon.ico" @@ -104,7 +105,9 @@ DefaultContentLanguage = "en" # == GERMAN == [Languages.de] languageCode = "de-DE" + languageName = "Deutsch" description = "Public Money, Public Code - Eine Kampagne zur Veröffentlichung öffentlich finanzierter Software als Freie Software" +# Navigation [Languages.de.navigation] brand = "Public Money, Public Code" [Languages.de.navigation.links] diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0fbe222..8eacb9c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,7 +5,11 @@ {{ with .Site.Params.description }}{{ end }} {{ .Hugo.Generator }} {{ .Site.Title }} - +{{ "" | safeHTML }} + +{{ range .Translations }} + +{{end}} {{ "" | safeHTML }} {{ "" | safeHTML }} diff --git a/layouts/partials/language.html b/layouts/partials/language.html index ac464ba..9625ba7 100644 --- a/layouts/partials/language.html +++ b/layouts/partials/language.html @@ -7,8 +7,10 @@

{{ .Site.Params.language.description }}: