Merge branch 'main' into main
This commit is contained in:
commit
ecb5604cdc
2 changed files with 16 additions and 12 deletions
|
@ -1,11 +1,8 @@
|
|||
{{/* 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. */}}
|
||||
|
||||
{{/* 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" }}
|
||||
|
@ -13,6 +10,13 @@
|
|||
{{ 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 }}
|
||||
|
||||
{{/* return the country code */}}
|
||||
|
|
|
@ -170,7 +170,7 @@ img.right {
|
|||
|
||||
.flag-icon {
|
||||
width: 16px !important;
|
||||
margin-top: 5px;
|
||||
margin-top: 3px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue