diff options
author | key-amb <yasutake.kiyoshi@gmail.com> | 2016-05-07 01:44:29 +0300 |
---|---|---|
committer | key-amb <yasutake.kiyoshi@gmail.com> | 2016-05-07 01:44:29 +0300 |
commit | 480a03ecd345fae7de7d7095ef2e0787d3db637b (patch) | |
tree | 7eaea26c35d09f4704bfada78b45fef9e37cd8e4 | |
parent | 2e5a0d1c82ad7682877dfcafed992a01309fbd1f (diff) |
Change: format of 'params.mainMenu' is now array of tables
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | layouts/partials/header.html | 6 |
2 files changed, 11 insertions, 4 deletions
@@ -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/ . diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a179dc7..058fe09 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -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 }} |