mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
menu: remove usage of Hugos UniqueID #131
This commit is contained in:
parent
d3b0b9a6fe
commit
a25243d7e7
1 changed files with 6 additions and 7 deletions
|
@ -96,11 +96,10 @@
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{{- define "section-tree-nav" }}
|
{{- define "section-tree-nav" }}
|
||||||
{{- $showvisitedlinks := .showvisitedlinks }}
|
{{- $showvisitedlinks := .showvisitedlinks }}
|
||||||
{{- $currentNode := .currentnode }}
|
{{- $currentNode := .currentnode }}
|
||||||
{{- $currentFileUniqueID := "" }}
|
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
||||||
{{- $alwaysopen := .alwaysopen }}
|
{{- $alwaysopen := .alwaysopen }}
|
||||||
{{- with $currentNode.File }}{{ $currentFileUniqueID = .UniqueID }}{{ end }}
|
|
||||||
{{- with .sect }}
|
{{- with .sect }}
|
||||||
{{- $hidden := and (eq (.Scratch.Get "relearnIsHiddenFromCurrent") true) (not $.showhidden) (not (.IsAncestor $currentNode)) }}
|
{{- $hidden := and (eq (.Scratch.Get "relearnIsHiddenFromCurrent") true) (not $.showhidden) (not (.IsAncestor $currentNode)) }}
|
||||||
{{- if $hidden }}
|
{{- if $hidden }}
|
||||||
|
@ -109,7 +108,7 @@
|
||||||
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
||||||
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||||
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
||||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}{{if .IsAncestor $currentNode }} parent{{end}}{{if $currentAlwaysopen}} alwaysopen{{end}}"><a href="{{.RelPermalink}}">
|
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .RelPermalink $currentFileRelPermalink}} active{{end}}{{if .IsAncestor $currentNode }} parent{{end}}{{if $currentAlwaysopen}} alwaysopen{{end}}"><a href="{{.RelPermalink}}">
|
||||||
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
||||||
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a><ul>
|
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a><ul>
|
||||||
{{- $pages := .Pages }}
|
{{- $pages := .Pages }}
|
||||||
|
@ -129,7 +128,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}</ul></li>
|
{{- end }}</ul></li>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}"><a href="{{.RelPermalink}}">
|
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .RelPermalink $currentFileRelPermalink}} active{{end}}"><a href="{{.RelPermalink}}">
|
||||||
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
||||||
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a></li>
|
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a></li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue