您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

31 行
1.6KB

  1. {{ $is_section_menu_enabled := ne .Site.Params.show_menu false }}
  2. {{ range $name, $entries := .Site.Menus }}
  3. {{ if or (ne $name "main") (and (eq $name "main") $is_section_menu_enabled) }}
  4. {{ with $.Site.Params.layout.menu }}
  5. {{ $settings := (index . $name) | default dict }}
  6. {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" $settings "page" $)}}
  7. {{ else }}
  8. {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" dict "page" $)}}
  9. {{ end }}
  10. {{ end }}
  11. {{ end }}
  12. <nav itemscope itemtype="https://schema.org/SiteNavigationElement">
  13. <meta itemprop="name" content="Translation Menu">
  14. {{ if ne .Page .Site.Home }}
  15. {{ if .IsTranslated }}
  16. {{ range .Translations }}
  17. <a itemprop="url" href="{{ .Permalink }}">
  18. {{ .Language.LanguageName }}
  19. <svg aria-hidden="true" class="i-flag" viewBox="0 0 32 32" width="14" height="14" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"><path d="M6 2 L6 30 M6 6 L26 6 20 12 26 18 6 18" /></svg>
  20. </a>
  21. {{ end }}
  22. {{ else if .Site.IsMultiLingual }}
  23. {{ $current_lang := .Page.Lang }}
  24. {{ range where .Site.Home.AllTranslations "Lang" "!=" $current_lang }}
  25. {{ .Language.LanguageName }}
  26. <svg aria-hidden="true" class="i-flag" viewBox="0 0 32 32" width="14" height="14" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"><path d="M6 2 L6 30 M6 6 L26 6 20 12 26 18 6 18" /></svg>
  27. {{ end }}
  28. {{ end }}
  29. {{ end }}
  30. </nav>