Commit 480a03ec authored by key-amb's avatar key-amb
Browse files

Change: format of 'params.mainMenu' is now array of tables

parent 2e5a0d1c
......@@ -29,8 +29,15 @@ You can customize the menu items in the header navigation bar by configuring `pa
```
# example of config.toml
[params]
mainMenu = ["about", "usage"]
highlightStyle = "github"
[[params.mainMenu]]
name = "Usage"
link = "usage"
[[params.mainMenu]]
name = "News"
link = "categories/news"
```
All other options and usages are described at the documentation site -- http://key-amb.github.io/bootie-docs-demo/ .
......
......@@ -35,9 +35,9 @@
<li {{ if eq $isHomePage true }}class="active"{{ end }}><a href="{{ $baseUrl }}/">Home</a></li>
{{ if isset .Site.Params "mainMenu" }}
{{ $url := .Permalink }}
{{ range $item := .Site.Params.mainMenu }}
{{ $itemUrl := printf "%s/%s/" $baseUrl $item }}
<li {{ if eq $url $itemUrl }}class="active"{{ end }}><a href="{{ $baseUrl }}/{{ $item }}">{{ title $item }}</a></li>
{{ range $menu := .Site.Params.mainMenu }}
{{ $itemUrl := printf "%s/%s/" $baseUrl $menu.link }}
<li {{ if eq $url $itemUrl }}class="active"{{ end }}><a href="{{ $baseUrl }}/{{ $menu.link }}">{{ $menu.name }}</a></li>
{{ end }}
{{ end }}
{{ if isset .Site.Params "noCategoryLink" }}{{ else }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment