Skip to content

Commit

Permalink
Output valid HTML (adityatelange#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenohassler authored and dunklecat committed Oct 8, 2022
1 parent a2a8022 commit 6cc1e76
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
{{- $label_text -}}
</a>
{{- end }}
<span class="logo-switches">
<div class="logo-switches">
{{- if (not site.Params.disableThemeToggle) }}
<button id="theme-toggle" accesskey="t" title="(Alt + T)">
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
Expand All @@ -121,7 +121,30 @@
</svg>
</button>
{{- end }}
</span>
<!-- </span> -->
{{- $lang := .Lang}}
{{- $separator := or $label_text (not site.Params.disableThemeToggle)}}
{{- with site.Home.AllTranslations }}
<ul class="lang-switch">
{{- if $separator }}<li>|</li>{{ end }}
{{- range . -}}
{{- if ne $lang .Lang }}
<li>
<a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}"
aria-label="{{ .Language.LanguageName | default (.Lang | title) }}">
{{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify -}}
{{- else }}
{{- .Lang | title -}}
{{- end -}}
</a>
</li>
{{- end -}}
{{- end}}
</ul>
{{- end }}
</div>
<!-- END HERE -->
</div>
{{- $currentPage := . }}
<ul id="menu">
Expand Down

0 comments on commit 6cc1e76

Please sign in to comment.