From f8541ef965ca22e746b523eb418e47cb4f78f2d8 Mon Sep 17 00:00:00 2001 From: Arne Rief Date: Fri, 9 Jan 2026 12:24:05 +0100 Subject: Upgrade to new template system from Hugo v0.146.0 --- layouts/_partials/select-language.html | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 layouts/_partials/select-language.html (limited to 'layouts/_partials/select-language.html') diff --git a/layouts/_partials/select-language.html b/layouts/_partials/select-language.html new file mode 100644 index 0000000..6efcc61 --- /dev/null +++ b/layouts/_partials/select-language.html @@ -0,0 +1,38 @@ +{{- /* +Selection of available languages. +Dynamically links to corresponding page/post if a translated version exists, otherwise to homepage of that language as fallback. + +Note: `$activeLang` and `$allTranslationsForPage` are technically unnecessary variables, their values could be called with `$.Lang` and `$.Translations` respectively. +These variables - together with the explicit naming of `.` context variables in other cases - were chosen for better readability and understandability of the code. +*/ -}} + +{{- if gt (len site.Languages) 1 }} +{{- $activeLang := .Lang }} +{{- $allTranslationsForPage := .Translations }} +
+ +
+{{- end }} -- cgit v1.2.3