diff options
author | Tina <feministclickback@mail36.net> | 2020-05-09 20:44:18 +0300 |
---|---|---|
committer | Tina <feministclickback@mail36.net> | 2020-05-09 20:44:18 +0300 |
commit | f73716ad6e442bdfda0445d389fc0955f8680390 (patch) | |
tree | 23961e1871251700f54f68ab7bb123198f0786f1 | |
parent | 19dddc5e1707d13af7a29a13f9327f0980cdd087 (diff) |
Add language switcher in Header
This shows language switcher in header only if params.languageSwitcher.
show in config.toml is set to `true`.
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/partials/header.html | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 822e614..d3ee3ad 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -94,6 +94,9 @@ themesDir = "../.." # Not necessary on production sites disable = false privacyEnhanced = true +[params.languageSwitcher] + show = true + [languages] [languages.en] languageName = "en" diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 212f470..4253522 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -11,4 +11,7 @@ {{ partial "menu.html" . }} {{ partial "hamburger-menu.html" . }} -</header>
\ No newline at end of file + {{ if $.Site.Params.languageSwitcher.show }} + {{ partial "language-switcher.html" . }} + {{ end }} +</header> |