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

github.com/tummychow/lanyon-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhavin Gandhi <bhavin7392@gmail.com>2020-01-25 16:29:38 +0300
committerBhavin Gandhi <bhavin7392@gmail.com>2020-03-28 21:13:35 +0300
commitc6c95b83d154e8c2b4853cebe40d60eba80e8e62 (patch)
treeacb8d437a4666cfbee82e013e7cce7cdd168d802
parentdbdba9c24cd91f4d78ef24e96e0212218ad443c2 (diff)
Add support for Menus
- https://gohugo.io/content-management/menus/ Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
-rw-r--r--layouts/partials/sidebar.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index f3f7b61..12a0a09 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -11,6 +11,10 @@
<nav class="sidebar-nav">
<a class="sidebar-nav-item {{ if .IsHome }} active {{ end }}" href="/">Home</a>
<a class="sidebar-nav-item {{ if eq .RelPermalink "/post/" }} active {{ end }}" href="/post">Posts</a>
+ {{- $currentPage := . }}
+ {{- range .Site.Menus.main -}}
+ <a class="sidebar-nav-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
+ {{- end -}}
{{- $thisperma := .Permalink }}
{{ range .Site.Pages.ByWeight -}}