mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-30 11:13:06 +00:00
theme: simplify menu traversal #380
This commit is contained in:
parent
ac406496ce
commit
972fc38d3f
2 changed files with 15 additions and 23 deletions
|
@ -138,7 +138,7 @@
|
||||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||||
{{- if $hidden }}
|
{{- if $hidden }}
|
||||||
{{- else if or .IsSection .IsHome }}
|
{{- else }}
|
||||||
{{- $numberOfVisibleChildren := 0 }}
|
{{- $numberOfVisibleChildren := 0 }}
|
||||||
{{- range $pages }}
|
{{- range $pages }}
|
||||||
{{- $isSelfSub := eq .RelPermalink $currentFileRelPermalink }}
|
{{- $isSelfSub := eq .RelPermalink $currentFileRelPermalink }}
|
||||||
|
@ -172,10 +172,6 @@
|
||||||
{{- 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 }}
|
||||||
{{- else }}
|
|
||||||
<li data-nav-id="{{.RelPermalink}}" class="dd-item{{if $isActive }} active{{end}}"><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
|
|
||||||
{{- 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>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -59,7 +59,7 @@
|
||||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||||
{{- if $hidden }}
|
{{- if $hidden }}
|
||||||
{{- else if or .IsSection .IsHome }}
|
{{- else }}
|
||||||
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
||||||
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||||
{{- if $isActive }}
|
{{- if $isActive }}
|
||||||
|
@ -83,10 +83,6 @@
|
||||||
</section>
|
</section>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
|
||||||
{{- if $isActive }}
|
|
||||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue