From 480a03ecd345fae7de7d7095ef2e0787d3db637b Mon Sep 17 00:00:00 2001 From: key-amb Date: Sat, 7 May 2016 07:44:29 +0900 Subject: Change: format of 'params.mainMenu' is now array of tables --- README.md | 9 ++++++++- layouts/partials/header.html | 6 +++--- 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 @@
  • Home
  • {{ if isset .Site.Params "mainMenu" }} {{ $url := .Permalink }} - {{ range $item := .Site.Params.mainMenu }} - {{ $itemUrl := printf "%s/%s/" $baseUrl $item }} -
  • {{ title $item }}
  • + {{ range $menu := .Site.Params.mainMenu }} + {{ $itemUrl := printf "%s/%s/" $baseUrl $menu.link }} +
  • {{ $menu.name }}
  • {{ end }} {{ end }} {{ if isset .Site.Params "noCategoryLink" }}{{ else }} -- cgit v1.2.3