nav.html (734B)
1 {{ range .Site.Menus.main.ByWeight }} 2 <a href="{{ .URL }}">{{ .Name }}</a> 3 {{ end }} 4 5 <!-- Convert this page's translations into a dict --> 6 {{ $translations := dict }} 7 {{ range .Translations }} 8 {{ $translations = merge $translations (dict .Language.Lang .) }} 9 {{ end }} 10 11 <!-- Create a link to every translation --> 12 {{ range where .Site.Languages "Lang" "!=" .Page.Lang }} 13 {{ with (index $translations .Lang) }} 14 <a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a> 15 {{ else }} 16 <!-- The complicated setup was necessary to make a grayed out link --> 17 {{ if not .Params.hideUntranslated }} 18 <a class="disabled" role="link" aria-disabled="true">{{ .LanguageName }}</a> 19 {{ end }} 20 {{ end }} 21 {{ end }} 22