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:
authorthingsym <thingsym@gmail.com>2022-07-06 13:01:25 +0300
committerthingsym <thingsym@gmail.com>2022-07-06 13:01:25 +0300
commit8fe225a991334a0482fbad4bed759a0722901878 (patch)
tree0866d4fe952c07cc409e320ff0ca03e09f2590a0
parent3e10bafa37083584e7f4990252d9e56dc02def04 (diff)
parentf2816255e4d518e6bd89f8b08f71d3bd9961c4fb (diff)
Merge branch 'master' into develop
-rw-r--r--layouts/partials/global-menu.html20
1 files changed, 17 insertions, 3 deletions
diff --git a/layouts/partials/global-menu.html b/layouts/partials/global-menu.html
index bd2dabd..132b26f 100644
--- a/layouts/partials/global-menu.html
+++ b/layouts/partials/global-menu.html
@@ -5,18 +5,32 @@
<ul>
{{- range .Site.Menus.main.ByWeight -}}
{{ if .HasChildren -}}
-<li class="parent{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}"><a href="{{ .URL }}">{{- .Name -}} <i class="fas fa-angle-right"></i></a>
+<li class="parent{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}">{{template "menu-item" dict "item" .}}
<ul class="sub-menu">
{{ range .Children -}}
-<li class="child{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}"><a href="{{ .URL }}">{{ .Name }}</a></li>
+<li class="child{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}">{{template "menu-item" dict "item" .}}</li>
{{ end -}}
</ul>
</li>
{{- else }}
-<li{{ if $currentPage.HasMenuCurrent "main" . }} class="active"{{ end }}><a href="{{ .URL }}">{{- .Name -}}</a></li>
+<li{{ if $currentPage.HasMenuCurrent "main" . }} class="active"{{ end }}>{{template "menu-item" dict "item" .}}</li>
{{- end -}}
{{- end -}}
</ul>
</nav>
</div>
{{- end }}
+
+{{define "menu-item"}}
+{{- with .item -}}
+<a href="{{ .URL }}">
+ {{- with .Pre -}}{{- . -}}{{- end -}}
+ {{- .Name -}}
+ {{- with .Post -}}{{- . -}}{{- end -}}
+ {{ if .HasChildren -}}
+ <i class="fas fa-angle-right"></i>
+ {{ end -}}
+</a>
+{{- end -}}
+{{- end -}}
+