the code for my website (https://www.annwan.me)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
859 B

10 months ago
  1. <p>
  2. {{ $siteLanguages := .Site.Languages }}
  3. {{ $pageLang := .Page.Lang }}
  4. {{ $currentPage := . }}
  5. {{ $pageName := "" }}
  6. {{ range .Site.Menus.main }}
  7. {{ if eq ($currentPage.Permalink) (.URL | absLangURL) }}
  8. {{ $pageName = .Name }}
  9. {{ end }}
  10. {{ end }}
  11. {{ range .Page.AllTranslations }}
  12. {{ $translation := .}}
  13. {{ range $siteLanguages }}
  14. {{ if eq $translation.Lang .Lang }}
  15. {{ $selected := false }}
  16. {{ if eq $pageLang .Lang }}
  17. <br/><span class="active">$ echo $LANG<br/><b>{{ .LanguageName }}</b></span><br/>
  18. {{ else }}
  19. <br/><a href="{{ $translation.Permalink }}">export LANG={{ .LanguageName }}; ./{{ $pageName }}</a><br/>
  20. {{ end }}
  21. {{ end }}
  22. {{ end }}
  23. {{ end }}
  24. </p>
  25. <br /><br />