From ade244c72af62827c4c30151404abf755597f243 Mon Sep 17 00:00:00 2001 From: Arne Rief Date: Mon, 1 Sep 2025 21:57:30 +0200 Subject: Search & socials --- layouts/partials/select-language.html | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..752b605 --- /dev/null +++ b/layouts/partials/select-language.html @@ -0,0 +1,39 @@ +{{- /* +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