Merge branch 'main' into main

This commit is contained in:
Emruz Hossain 2021-05-17 23:48:41 +06:00 committed by GitHub
commit ecb5604cdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View file

@ -1,17 +1,21 @@
{{/* if there is no custom flag provided, we define the flag with the country code */}} {{/* if there is no custom flag provided, we define the flag with the country code */}}
{{ $languageCode:= .Lang }} {{ $languageCode:= .Lang }}
{{ $countryCode:= $languageCode }} {{ $countryCode:= $languageCode }}
{{/* if the user has selected a custom flag, display it */}}
{{ if isset .Site.Params "flag" }} {{/* language code and country code are not same for some countries. we need to fix them. */}}
{{ $countryCode = .Param "flag" }} {{ if eq $languageCode "en" }}
{{ else }} {{ $countryCode = "gb" }}
{{/* but some language codes dont have an equivalent country code. we need to fix them. */}} {{ else if eq $languageCode "bn" }}
{{ if eq $languageCode "en" }} {{ $countryCode = "bd" }}
{{ $countryCode = "gb" }} {{ else if eq $languageCode "hi" }}
{{ else if eq $languageCode "bn" }} {{ $countryCode = "in" }}
{{ $countryCode = "bd" }} {{ end }}
{{ else if eq $languageCode "hi" }}
{{ $countryCode = "in" }}
{{/* 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 }}
{{ end }} {{ end }}

View file

@ -170,7 +170,7 @@ img.right {
.flag-icon { .flag-icon {
width: 16px !important; width: 16px !important;
margin-top: 5px; margin-top: 3px;
margin-right: 3px; margin-right: 3px;
} }