Added showFlags parameter
This commit is contained in:
parent
9e5b1426e3
commit
5940a4ea5e
4 changed files with 24 additions and 15 deletions
|
@ -145,6 +145,9 @@ params:
|
|||
# specify whether you want to show Table of Contents in reading page
|
||||
enableTOC: true
|
||||
|
||||
# specify whether you want the language flags to be displayed.
|
||||
showFlags: true
|
||||
|
||||
# Provide newsletter configuration.
|
||||
# This feature has been implemented for Mailchimp only for now.
|
||||
# You can also hide it from the footer.
|
||||
|
|
|
@ -20,5 +20,10 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* if specified via "params.showFlags" field, then countryCode is set to be empty. */}}
|
||||
{{ if eq site.Params.showFlags false }}
|
||||
{{ $countryCode = "" }}
|
||||
{{ end }}
|
||||
|
||||
{{/* return the country code */}}
|
||||
{{ return $countryCode }}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{ $countryCode := partial "helpers/country-code.html" . }}
|
||||
{{ if ne $countryCode nil }}
|
||||
{{ if ne $countryCode "" }}
|
||||
<span class="flag-icon flag-icon-{{$countryCode}}"></span>
|
||||
{{ end }}
|
||||
{{ site.Language.LanguageName }}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{ $countryCode := partial "helpers/country-code.html" . }}
|
||||
{{ if ne $countryCode nil }}
|
||||
{{ if ne $countryCode "" }}
|
||||
<span class="flag-icon flag-icon-{{$countryCode}}"></span>
|
||||
{{ end }}
|
||||
{{ site.Language.LanguageName }}
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="languageSelector">
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="languageSelector">
|
||||
{{ range site.Home.AllTranslations }}
|
||||
<a class="dropdown-item nav-link languages-item" href="{{ .RelPermalink }}">
|
||||
{{ $countryCode := partial "helpers/country-code.html" . }}
|
||||
|
@ -14,5 +14,6 @@
|
|||
{{ .Language.LanguageName }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</li>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue