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/footer.html | 42 ++++++++++++++++++++++++++++++++--- layouts/partials/header.html | 4 ++-- layouts/partials/select-language.html | 39 ++++++++++++++++++++++++++++++++ layouts/partials/select-theme.html | 15 +++++++++++++ layouts/partials/selectLanguage.html | 39 -------------------------------- layouts/partials/selectTheme.html | 15 ------------- 6 files changed, 95 insertions(+), 59 deletions(-) create mode 100644 layouts/partials/select-language.html create mode 100644 layouts/partials/select-theme.html delete mode 100644 layouts/partials/selectLanguage.html delete mode 100644 layouts/partials/selectTheme.html (limited to 'layouts/partials') diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 7225d09..9b66758 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,7 +1,43 @@ diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9195345..0f3cfce 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -7,6 +7,6 @@ {{- end }} - {{- partial "selectTheme.html" . }} - {{- partial "selectLanguage.html" . }} + {{- partial "select-theme.html" . }} + {{- partial "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 }} diff --git a/layouts/partials/select-theme.html b/layouts/partials/select-theme.html new file mode 100644 index 0000000..e9114cc --- /dev/null +++ b/layouts/partials/select-theme.html @@ -0,0 +1,15 @@ + diff --git a/layouts/partials/selectLanguage.html b/layouts/partials/selectLanguage.html deleted file mode 100644 index 752b605..0000000 --- a/layouts/partials/selectLanguage.html +++ /dev/null @@ -1,39 +0,0 @@ -{{- /* -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 }} diff --git a/layouts/partials/selectTheme.html b/layouts/partials/selectTheme.html deleted file mode 100644 index e9114cc..0000000 --- a/layouts/partials/selectTheme.html +++ /dev/null @@ -1,15 +0,0 @@ - -- cgit v1.2.3