hugo-geekdoc/layouts/partials/menu.html

45 lines
1.3 KiB
HTML
Raw Permalink Normal View History

2020-01-12 14:33:02 +00:00
<nav>
{{ partial "search" . }}
2020-01-12 14:33:02 +00:00
<section class="gdoc-nav--main">
<h2>{{ i18n "nav_navigation" }}</h2>
{{ if .Site.Params.geekdocMenuBundle }}
{{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.main.main) }}
{{ else }}
{{ partial "menu-filetree" . }}
{{ end }}
</section>
{{ if and (in (slice "posts" "tags") .Section) (default false .Site.Params.geekdocTagsToMenu) }}
2021-09-01 08:18:00 +00:00
<section class="gdoc-nav--tags">
<h2>{{ i18n "nav_tags" }}</h2>
<ul class="gdoc-nav__list">
{{ $currentPage := .RelPermalink }}
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }}
2021-09-01 08:18:00 +00:00
<li>
<a
class="gdoc-nav__entry{{- if eq $currentPage .RelPermalink }}
{{- printf " is-active" }}
{{- end }}"
href="{{ .RelPermalink }}"
>
{{ partial "utils/title" . }}
</a>
2021-09-01 08:18:00 +00:00
</li>
{{ end }}
2020-01-12 14:33:02 +00:00
{{ end }}
</ul>
2020-01-12 14:33:02 +00:00
</section>
{{ end }}
<section class="gdoc-nav--more">
{{ if .Site.Data.menu.more.more }}
<h2>{{ i18n "nav_more" }}</h2>
{{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.more.more) }}
{{ end }}
</section>
2020-01-12 14:33:02 +00:00
</nav>