mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-06 14:14:04 +00:00
34 lines
1.2 KiB
HTML
34 lines
1.2 KiB
HTML
{{ $current_page := . }}
|
|
{{ $menu_name := (path.Base (path.Split .Path).Dir) }}
|
|
{{ with (index .Site.Menus $menu_name) }}
|
|
{{ else }}
|
|
{{ errorf "Please define menu items named `[menu.%s]` in your %s front matter or define `[[menu.%s]]` in `config.toml`." $menu_name .Path $menu_name }}
|
|
{{ end }}
|
|
|
|
{{ if eq $.Site.Params.search.engine 1 }}
|
|
<form class="docs-search d-flex align-items-center">
|
|
<input name="q" type="search" class="form-control" id="search-query" placeholder="{{ i18n "search_placeholder" }}" autocomplete="off">
|
|
</form>
|
|
{{ end }}
|
|
|
|
<nav class="docs-links" id="docs-nav">
|
|
{{ with (index .Site.Menus $menu_name) }}
|
|
{{ range (index $.Site.Menus $menu_name).ByWeight }}
|
|
<div class="docs-toc-item{{ if $current_page.IsMenuCurrent $menu_name . }} active{{ end }}">
|
|
<a class="docs-toc-link" {{ if .URL }}href="{{ .URL }}"{{else if .HasChildren }}href="{{ (index .Children 0).URL }}"{{end}}>{{ .Name }}</a>
|
|
|
|
{{- if .HasChildren }}
|
|
<ul class="nav docs-sidenav">
|
|
{{ range .Children }}
|
|
<li {{ if $current_page.IsMenuCurrent $menu_name . }}class="active"{{ end }}>
|
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
{{ end }}
|
|
|
|
</div>
|
|
{{ end }}
|
|
{{ end }}
|
|
</nav>
|