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

github.com/thingsym/hugo-theme-techdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/partials/global-menu.html9
1 files changed, 4 insertions, 5 deletions
diff --git a/layouts/partials/global-menu.html b/layouts/partials/global-menu.html
index 132b26f..3d0e115 100644
--- a/layouts/partials/global-menu.html
+++ b/layouts/partials/global-menu.html
@@ -5,15 +5,15 @@
<ul>
{{- range .Site.Menus.main.ByWeight -}}
{{ if .HasChildren -}}
-<li class="parent{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}">{{template "menu-item" dict "item" .}}
+<li{{ with .Identifier }} id="{{ . }}"{{ end }} class="parent{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }} {{ with .Params.class }}{{ . }}{{ end }}">{{template "menu-item" dict "item" .}}
<ul class="sub-menu">
{{ range .Children -}}
-<li class="child{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}">{{template "menu-item" dict "item" .}}</li>
+<li{{ with .Identifier }} id="{{ . }}"{{ end }} class="child{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }} {{ with .Params.class }}{{ . }}{{ end }}">{{template "menu-item" dict "item" .}}</li>
{{ end -}}
</ul>
</li>
{{- else }}
-<li{{ if $currentPage.HasMenuCurrent "main" . }} class="active"{{ end }}>{{template "menu-item" dict "item" .}}</li>
+<li{{ with .Identifier }} id="{{ . }}"{{ end }}{{ if $currentPage.HasMenuCurrent "main" . }} class="active {{with .Params.class}}{{ . }}{{ end }}"{{ else }} class="{{ with .Params.class }}{{ . }}{{ end }}"{{ end }}>{{template "menu-item" dict "item" .}}</li>
{{- end -}}
{{- end -}}
</ul>
@@ -29,8 +29,7 @@
{{- with .Post -}}{{- . -}}{{- end -}}
{{ if .HasChildren -}}
<i class="fas fa-angle-right"></i>
- {{ end -}}
+ {{ end -}}
</a>
{{- end -}}
{{- end -}}
-