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

github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2019-02-08 00:57:14 +0300
committerZachary Betz <zwbetz@gmail.com>2019-02-08 00:57:14 +0300
commitfaa24e7eef3d0f8a3b008dc759516cf2f74488b7 (patch)
tree66807378dcd3016c063e726a10a14233dfd52105
parent358aed95c65274de72c3737730e56c00ccc1fb24 (diff)
Change navigation menu name
-rw-r--r--exampleSite/config.toml10
-rw-r--r--exampleSite/config.yaml2
-rw-r--r--layouts/partials/nav.html4
3 files changed, 8 insertions, 8 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 0c3eb6d..5dc1beb 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -19,27 +19,27 @@ googleAnalytics = "UA-123456789-1"
# See https://feathericons.com/
# The value of pre is the icon name
[menu]
- [[menu.main]]
+ [[menu.nav]]
name = "Home"
pre = "home"
url = "/"
weight = 1
- [[menu.main]]
+ [[menu.nav]]
name = "Blog"
pre = "edit"
url = "/post/"
weight = 2
- [[menu.main]]
+ [[menu.nav]]
name = "Tags"
pre = "tag"
url = "/tags/"
weight = 3
- [[menu.main]]
+ [[menu.nav]]
name = "About"
pre = "smile"
url = "/about/"
weight = 4
- [[menu.main]]
+ [[menu.nav]]
name = "RSS"
pre = "rss"
url = "/index.xml"
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index 365b142..4fcd6fe 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -19,7 +19,7 @@ permalinks:
# See https://feathericons.com/
# The value of pre is the icon name
menu:
- main:
+ nav:
- name: Home
pre: home
url: /
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 9ca3c7c..95699c8 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -2,10 +2,10 @@
<nav id="nav" class="nav justify-content-center">
{{ $showActiveNav := .Site.Params.showActiveNav }}
{{ $currentPage := . }}
- {{ range .Site.Menus.main }}
+ {{ range .Site.Menus.nav }}
{{ $active := "" }}
{{ if eq $showActiveNav true }}
- {{ $isMenu := or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
+ {{ $isMenu := or ($currentPage.IsMenuCurrent "nav" .) ($currentPage.HasMenuCurrent "nav" .) }}
{{ if or $isMenu (eq $currentPage.Title .Name) }}
{{ $active = "nav-link-active" }}
{{ end }}