🐛 Correctly display available translations in header

Fixes: #565
pull/575/head
James Panther 2023-06-04 10:20:41 +10:00
parent d2a1b70ae2
commit 7ec5faff37
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
2 changed files with 13 additions and 8 deletions

View File

@ -8,10 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
- Updated Simplified Chinese (China) translateion ([#573](https://github.com/jpanther/congo/pull/573))
- Current language is no longer displayed in language selection ([#565](https://github.com/jpanther/congo/issues/565))
- Updated Simplified Chinese (China) translation ([#573](https://github.com/jpanther/congo/pull/573))
### Fixed
- Language selection repeats current language on multilingual sites instead of linking to translated content ([#565](https://github.com/jpanther/congo/issues/565))
- Icon padding inconsistent when using `--minify` option to build site ([#568](https://github.com/jpanther/congo/pull/568))
- Upgrade to Mermaid v10.2.1 ([#569](https://github.com/jpanther/congo/pull/569))

View File

@ -1,13 +1,16 @@
{{ if .IsTranslated }}
{{ $currentLang := .Page.Lang }}
<ul class="flex list-none flex-row">
{{ range .AllTranslations }}
{{ if ne $currentLang .Lang }}
<li class="ml-2">
<a
href="{{ .RelPermalink }}"
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
>{{ site.Params.displayName | emojify }}</a
>{{ .Site.Params.displayName | emojify }}</a
>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}