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:
authorYASUTAKE Kiyoshi <quee.amb@gmail.com>2016-05-07 01:53:52 +0300
committerYASUTAKE Kiyoshi <quee.amb@gmail.com>2016-05-07 01:53:52 +0300
commit09ae43f05fde8fc8e6f9f38a1b27e26b70b4887d (patch)
tree7eaea26c35d09f4704bfada78b45fef9e37cd8e4
parent2e5a0d1c82ad7682877dfcafed992a01309fbd1f (diff)
parent480a03ecd345fae7de7d7095ef2e0787d3db637b (diff)
Merge pull request #14 from key-amb/develop
Change: format of 'params.mainMenu' is now array of tables
-rw-r--r--README.md9
-rw-r--r--layouts/partials/header.html6
2 files changed, 11 insertions, 4 deletions
diff --git a/README.md b/README.md
index 6074f4d..545212d 100644
--- a/README.md
+++ b/README.md
@@ -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 }}