From f7847b6a3abc6dd2f67839c80a1144200768dd68 Mon Sep 17 00:00:00 2001 From: Helder Pereira Date: Tue, 11 Feb 2020 23:33:18 +0000 Subject: [PATCH] Fix .File.UniqueID on zero object warning --- layouts/partials/menu.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index a6be42fa6f..0f9c8f8a5a 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -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}}
  • @@ -137,7 +139,7 @@
  • {{else}} {{ if not .Params.Hidden }} -
  • +
  • {{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}} {{ if $showvisitedlinks}}{{end}} @@ -147,4 +149,3 @@ {{end}} {{ end }} {{ end }} -