Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/progrhyme/hugo-theme-bootie-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkey-amb <yasutake.kiyoshi@gmail.com>2017-03-05 04:35:10 +0300
committerkey-amb <yasutake.kiyoshi@gmail.com>2017-03-05 04:35:10 +0300
commit5b14e4081c0d6d591150df486f558640f8c7c8be (patch)
tree2fde60f31f1b3c11b793fb0a823e8d0fe41b5026
parent1137a65b34bbf47d96c34c12a121670ae4528c15 (diff)
Change / Switch to Hugo's built-in Menu System.
See https://github.com/key-amb/hugo-theme-bootie-docs/issues/23
-rw-r--r--layouts/partials/header.html7
1 files changed, 3 insertions, 4 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index bd8b3f8..3432669 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -32,11 +32,10 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {{ if .IsHome }}class="active"{{ end }}><a href="{{ $baseUrl }}/">Home</a></li>
- {{ $url := .Permalink }}
- {{ with .Site.Params.mainMenu }}
+ {{ $url := .URL }}
+ {{ with .Site.Menus.main }}
{{ range $menu := . }}
- {{ $itemUrl := printf "%s/%s" $baseUrl $menu.link }}
- <li {{ if eq $url $itemUrl }}class="active"{{ end }}><a href="{{ $baseUrl }}/{{ $menu.link }}">{{ $menu.name }}</a></li>
+ <li {{ if eq $url .URL }}class="active"{{ end }}><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ if not .Site.Params.noCategoryLink }}