layouts/single: fix Lang Name hidden when LanguageName

was unset
This commit is contained in:
Aditya Telange 2020-11-08 23:04:24 +05:30
parent 77baa3d76e
commit b5d55aee8d
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
1 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,13 @@
{{- i18n "translations" | default "Translations"}}: {{- i18n "translations" | default "Translations"}}:
{{- range .Translations }} {{- range .Translations }}
<li> <li>
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> <a href="{{ .Permalink }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | humanize -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li> </li>
{{- end }} {{- end }}
</ul> </ul>