diff --git a/layouts/partials/helpers/country-code.html b/layouts/partials/helpers/country-code.html index 261b66c..d157de0 100644 --- a/layouts/partials/helpers/country-code.html +++ b/layouts/partials/helpers/country-code.html @@ -1,17 +1,21 @@ {{/* if there is no custom flag provided, we define the flag with the country code */}} {{ $languageCode:= .Lang }} {{ $countryCode:= $languageCode }} -{{/* 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" }} + +{{/* 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" }} +{{ end }} + + +{{/* if the user specify a country code for a language via "params.flagOverwrites" field, then use it. */}} +{{ range site.Params.flagOverwrites }} + {{ if eq $languageCode .languageCode }} + {{ $countryCode = .countryCode }} {{ end }} {{ end }} diff --git a/static/css/layouts/main.css b/static/css/layouts/main.css index 7064658..e028f3f 100644 --- a/static/css/layouts/main.css +++ b/static/css/layouts/main.css @@ -170,7 +170,7 @@ img.right { .flag-icon { width: 16px !important; - margin-top: 5px; + margin-top: 3px; margin-right: 3px; }