Fix '.File.UniqueID on zero object' warning
This commit is contained in:
parent
6a834ae6b8
commit
3439e019b0
1 changed files with 5 additions and 1 deletions
|
@ -80,8 +80,12 @@
|
||||||
{{ $currentNode := .currentnode }}
|
{{ $currentNode := .currentnode }}
|
||||||
{{with .sect}}
|
{{with .sect}}
|
||||||
{{safeHTML .Params.head}}
|
{{safeHTML .Params.head}}
|
||||||
|
{{ $fileUniqueID := "" }}
|
||||||
|
{{ with .File }}{{ $fileUniqueID = .UniqueID }}{{ end }}
|
||||||
|
{{ $currentNodeFileUniqueID := "" }}
|
||||||
|
{{ with $currentNode.File }}{{ $currentNodeFileUniqueID = .UniqueID }}{{ end }}
|
||||||
<li data-nav-id="{{.Permalink}}" title="{{.Title}}" class="sidelist
|
<li data-nav-id="{{.Permalink}}" title="{{.Title}}" class="sidelist
|
||||||
{{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}">
|
{{if eq $fileUniqueID $currentNodeFileUniqueID}}active{{end}}">
|
||||||
<a href="{{.Permalink}}">
|
<a href="{{.Permalink}}">
|
||||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue