menu.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <nav>
  2. {{ partial "search" . }}
  3. <section class="gdoc-nav--main">
  4. <h2>{{ i18n "nav_navigation" }}</h2>
  5. {{ if .Site.Params.geekdocMenuBundle }}
  6. {{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.main.main) }}
  7. {{ else }}
  8. {{ partial "menu-filetree" . }}
  9. {{ end }}
  10. </section>
  11. {{ if and (in (slice "posts" "tags") .Section) (default false .Site.Params.geekdocTagsToMenu) }}
  12. <section class="gdoc-nav--tags">
  13. <h2>{{ i18n "nav_tags" }}</h2>
  14. <ul class="gdoc-nav__list">
  15. {{ $currentPage := .RelPermalink }}
  16. {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
  17. {{ with $.Site.GetPage (printf "/tags/%s" $name) }}
  18. <li>
  19. <a
  20. class="gdoc-nav__entry{{- if eq $currentPage .RelPermalink }}
  21. {{- printf " is-active" }}
  22. {{- end }}"
  23. href="{{ .RelPermalink }}"
  24. >
  25. {{ partial "utils/title" . }}
  26. </a>
  27. </li>
  28. {{ end }}
  29. {{ end }}
  30. </ul>
  31. </section>
  32. {{ end }}
  33. <section class="gdoc-nav--more">
  34. {{ if .Site.Data.menu.more.more }}
  35. <h2>{{ i18n "nav_more" }}</h2>
  36. {{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.more.more) }}
  37. {{ end }}
  38. </section>
  39. </nav>