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

github.com/gizak/nofancy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi-aung 'Lewis' Yip <liaung@gmail.com>2016-12-30 11:05:33 +0300
committerLi-aung 'Lewis' Yip <liaung@gmail.com>2016-12-30 11:05:33 +0300
commitd54dd54428274e095564557e35c3e36f05c1a8fd (patch)
tree21db4ff565585c3349cfed1036110b055075b83b
parent15ab57d2998e84166ff95f934141e0b35f6195b6 (diff)
Add config switch to turn off categories listing in top nav menu
-rw-r--r--README.md7
-rw-r--r--layouts/partials/navbar.html4
2 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index 1f1af5f..ded48ce 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,12 @@ copyright = "Copyright (c) 2008 - 2014, Steve Francia; all rights reserved."
[params]
highlight="Assign a syntax highlight style"
-
+
+ # Controls what items are listed in the top nav menu
+ # "none", or "categories"
+ # If you have too many categories to fit in the top nav menu, set this to "none"
+ topmenu="categories"
+
[author]
name = "Steve Francia"
github = "spf13"
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html
index 8e77c72..bdb1c0a 100644
--- a/layouts/partials/navbar.html
+++ b/layouts/partials/navbar.html
@@ -5,11 +5,13 @@
{{ $baseurl := .Site.BaseURL }}
<a href="{{$baseurl}}" class="site-title pure-menu-heading">{{ .Site.Title }}</a>
<ul class="pure-menu-list">
+ {{ if eq .Site.Params.topmenu "categories" }}
{{ range $name,$page := .Site.Taxonomies.categories }}
<li class="pure-menu-item">
<a href="{{ $baseurl }}categories/{{ $name | urlize }}" class="pure-menu-link">{{ $name | title }}</a>
</li>
{{ end }}
+ {{ end }}
<li class="pure-menu-item">
<a href="{{ $baseurl }}about/" class="pure-menu-link">About</a>
</li>
@@ -20,11 +22,13 @@
<a href="#" id="toggle-btn">&#9776;</a>
<ul class="pure-menu-list" id="toggle-content" style="display:none;">
{{ $baseurl := .Site.BaseURL }}
+ {{ if eq .Site.Params.topmenu "categories" }}
{{ range $name,$page := .Site.Taxonomies.categories }}
<li class="pure-menu-item">
<a href="{{ $baseurl }}categories/{{ $name | urlize }}" class="pure-menu-link">{{ $name | title }}</a>
</li>
{{ end }}
+ {{ end }}
<li class="pure-menu-item">
<a href="{{ .Site.BaseURL }}about" class="pure-menu-link">About</a>
</li>