diff --git a/README.md b/README.md index 51787750..1083dd51 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ - Social Icons (home-info and profile-mode) - Social-Media Share buttons on posts. - Menu location indicator. -- Multilingual support. (with language selector) +- Multilingual support (with improved language selector) - Taxonomies - Cover image for each post (with Responsive image support). - Light/Dark theme (automatic theme switch a/c to browser theme and theme-switch button). diff --git a/layouts/_default/search.html b/layouts/_default/search.html index 2349587b..7addf257 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -13,10 +13,10 @@ {{ .Description }} {{- end }} - {{- if not (.Param "hideMeta") }} -
- {{- partial "translation_list.html" . -}} -
+ {{- if and (.Param "showTranslationListInPosts") (not (.Param "hideMeta")) }} +
+ {{- partial "translation_list.html" . -}} +
{{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b7497255..ef4dfad2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -15,7 +15,9 @@ {{- if not (.Param "hideMeta") }}
{{- partial "post_meta.html" . -}} - {{- partial "translation_list.html" . -}} + {{- if .Param "showTranslationListInPosts" }} + {{- partial "translation_list.html" . -}} + {{- end }} {{- partial "edit_post.html" . -}} {{- partial "post_canonical.html" . -}}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4a7291e2..2135456b 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -96,27 +96,42 @@ {{- end }} - {{- $lang := .Lang}} - {{- $separator := or $label_text (not site.Params.disableThemeToggle)}} - {{- with site.Home.AllTranslations }} - - {{- end }} + {{/* LANGUAGE SELECTOR */}} + {{ if .Site.IsMultiLingual }} + {{/* set vars with page data */}} + {{ $currentLang := .Lang }} + {{ $allTranslations := .Translations }} + + {{ $separator := or $label_text (not site.Params.disableThemeToggle)}} + + + {{ end }} {{- $currentPage := . }}