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:
Diffstat (limited to 'layouts/partials/global-menu.html')
-rw-r--r--layouts/partials/global-menu.html11
1 files changed, 5 insertions, 6 deletions
diff --git a/layouts/partials/global-menu.html b/layouts/partials/global-menu.html
index 132b26f..a7a7038 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>
@@ -27,10 +27,9 @@
{{- with .Pre -}}{{- . -}}{{- end -}}
{{- .Name -}}
{{- with .Post -}}{{- . -}}{{- end -}}
- {{ if .HasChildren -}}
+ {{- if .HasChildren -}}
<i class="fas fa-angle-right"></i>
- {{ end -}}
+ {{- end -}}
</a>
{{- end -}}
{{- end -}}
-