Merge pull request #135 from life1347/fix-zero-obj-warning
Fix '.File.UniqueID on zero object' warning
This commit is contained in:
commit
3356704ddf
1 changed files with 5 additions and 1 deletions
|
@ -80,8 +80,12 @@
|
|||
{{ $currentNode := .currentnode }}
|
||||
{{with .sect}}
|
||||
{{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
|
||||
{{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}">
|
||||
{{if eq $fileUniqueID $currentNodeFileUniqueID}}active{{end}}">
|
||||
<a href="{{.Permalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue