Allow overwriting country flag for a language (#316)
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
{{/* by default the language code and the country code are same */}}
|
{{/* by default the language code and the country code are same */}}
|
||||||
{{ $countryCode:= $languageCode }}
|
{{ $countryCode:= $languageCode }}
|
||||||
|
|
||||||
{{/* language code and country code are not same for some countries. we need to fix them. */}}
|
{{/* language code and country code are not same for some countries. we need to fix them. */}}
|
||||||
{{ if eq $languageCode "en" }}
|
{{ if eq $languageCode "en" }}
|
||||||
{{ $countryCode = "gb" }}
|
{{ $countryCode = "gb" }}
|
||||||
{{ else if eq $languageCode "bn" }}
|
{{ else if eq $languageCode "bn" }}
|
||||||
@@ -11,5 +11,13 @@
|
|||||||
{{ $countryCode = "in" }}
|
{{ $countryCode = "in" }}
|
||||||
{{ end }}
|
{{ 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 }}
|
||||||
|
|
||||||
{{/* return the country code */}}
|
{{/* return the country code */}}
|
||||||
{{ return $countryCode }}
|
{{ return $countryCode }}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user