mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
Fix .File.UniqueID on zero object warning
This commit is contained in:
parent
41c6cc522f
commit
f7847b6a3a
1 changed files with 4 additions and 3 deletions
|
@ -94,12 +94,14 @@
|
|||
{{ define "section-tree-nav" }}
|
||||
{{ $showvisitedlinks := .showvisitedlinks }}
|
||||
{{ $currentNode := .currentnode }}
|
||||
{{ $currentFileUniqueID := "" }}
|
||||
{{ with $currentNode.File }}{{ $currentFileUniqueID = .UniqueID }}{{ end }}
|
||||
{{with .sect}}
|
||||
{{if and .IsSection ((not .Params.hidden) or $.showhidden)}}
|
||||
{{safeHTML .Params.head}}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
|
||||
{{if .IsAncestor $currentNode }}parent{{end}}
|
||||
{{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}
|
||||
{{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}
|
||||
{{if .Params.alwaysopen}}parent{{end}}
|
||||
">
|
||||
<a href="{{.RelPermalink}}">
|
||||
|
@ -137,7 +139,7 @@
|
|||
</li>
|
||||
{{else}}
|
||||
{{ if not .Params.Hidden }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item {{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}">
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item {{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}">
|
||||
<a href="{{ .RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
{{ if $showvisitedlinks}}<i class="fas fa-check read-icon"></i>{{end}}
|
||||
|
@ -147,4 +149,3 @@
|
|||
{{end}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue