diff --git a/layouts/partials/helpers/country-code.html b/layouts/partials/helpers/country-code.html index f93a633..261b66c 100644 --- a/layouts/partials/helpers/country-code.html +++ b/layouts/partials/helpers/country-code.html @@ -1,14 +1,18 @@ +{{/* if there is no custom flag provided, we define the flag with the country code */}} {{ $languageCode:= .Lang }} -{{/* by default the language code and the country code are same */}} {{ $countryCode:= $languageCode }} - -{{/* language code and country code are not same for some countries. we need to fix them. */}} -{{ if eq $languageCode "en" }} - {{ $countryCode = "gb" }} -{{ else if eq $languageCode "bn" }} - {{ $countryCode = "bd" }} -{{ else if eq $languageCode "hi" }} - {{ $countryCode = "in" }} +{{/* if the user has selected a custom flag, display it */}} +{{ if isset .Site.Params "flag" }} + {{ $countryCode = .Param "flag" }} +{{ else }} + {{/* but some language codes dont have an equivalent country code. we need to fix them. */}} + {{ if eq $languageCode "en" }} + {{ $countryCode = "gb" }} + {{ else if eq $languageCode "bn" }} + {{ $countryCode = "bd" }} + {{ else if eq $languageCode "hi" }} + {{ $countryCode = "in" }} + {{ end }} {{ end }} {{/* return the country code */}} diff --git a/layouts/partials/navigators/floating-lang-selector.html b/layouts/partials/navigators/floating-lang-selector.html index b76dfec..4ac752d 100644 --- a/layouts/partials/navigators/floating-lang-selector.html +++ b/layouts/partials/navigators/floating-lang-selector.html @@ -5,17 +5,17 @@ \ No newline at end of file + diff --git a/layouts/partials/navigators/lang-selector-2.html b/layouts/partials/navigators/lang-selector-2.html index 9c4e240..4fffc32 100644 --- a/layouts/partials/navigators/lang-selector-2.html +++ b/layouts/partials/navigators/lang-selector-2.html @@ -5,17 +5,17 @@ \ No newline at end of file + diff --git a/layouts/partials/navigators/lang-selector.html b/layouts/partials/navigators/lang-selector.html index 4948370..4221a71 100644 --- a/layouts/partials/navigators/lang-selector.html +++ b/layouts/partials/navigators/lang-selector.html @@ -1,16 +1,16 @@ \ No newline at end of file +