From 5940a4ea5efc6778d2aa414c9224e4c0fb9d6cb5 Mon Sep 17 00:00:00 2001 From: Gabriel Jean <29616662+GabrielJean@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:12:11 +0000 Subject: [PATCH] Added showFlags parameter --- README.md | 3 ++ layouts/partials/helpers/country-code.html | 5 ++++ .../partials/navigators/lang-selector-2.html | 2 +- .../partials/navigators/lang-selector.html | 29 ++++++++++--------- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2971be9..428576c 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,9 @@ params: # specify whether you want to show Table of Contents in reading page enableTOC: true + # specify whether you want the language flags to be displayed. + showFlags: true + # Provide newsletter configuration. # This feature has been implemented for Mailchimp only for now. # You can also hide it from the footer. diff --git a/layouts/partials/helpers/country-code.html b/layouts/partials/helpers/country-code.html index 925d70e..0c5e365 100644 --- a/layouts/partials/helpers/country-code.html +++ b/layouts/partials/helpers/country-code.html @@ -20,5 +20,10 @@ {{ end }} {{ end }} +{{/* if specified via "params.showFlags" field, then countryCode is set to be empty. */}} +{{ if eq site.Params.showFlags false }} + {{ $countryCode = "" }} +{{ end }} + {{/* return the country code */}} {{ return $countryCode }} diff --git a/layouts/partials/navigators/lang-selector-2.html b/layouts/partials/navigators/lang-selector-2.html index 8ad4bc4..606a503 100644 --- a/layouts/partials/navigators/lang-selector-2.html +++ b/layouts/partials/navigators/lang-selector-2.html @@ -6,7 +6,7 @@