{{- $showvisitedlinks := .Site.Params.showVisitedLinks }} {{- define "partials/inline/page-tree" }} {{- $currentNode := .currentnode }} {{- $config := .config }} {{- $showvisitedlinks := .showvisitedlinks }}
{{- else }} {{- warnf "WARNING: page '%s' not found for sidebar menu '%s'" ($config.pageRef | default "") $config.identifier }} {{- end }} {{- end }} {{- define "partials/inline/page-walker" }} {{- $currentNode := .currentnode }} {{- $showvisitedlinks := .showvisitedlinks }} {{- $alwaysopen := .alwaysopen }} {{- $isSelf := .isSelf }} {{- $isAncestor := .isAncestor }} {{- $isHidden := .isHidden }} {{- with .sect }} {{- $isActive := $isSelf }} {{- $entry := . }} {{- $entries := partialCached "_relearn/pages.gotmpl" (dict "page" .) .Path }} {{- $hasVisibleChildren := false }} {{- range $entries }} {{- $isSubSelf := eq . $currentNode }} {{- $isSubAncestor := and (not $isSubSelf) (.IsAncestor $currentNode) }} {{- $isSubHidden := or (.Params.hidden) (eq .Title "") }} {{- if or $isSubAncestor $isSubSelf (not $isSubHidden) }} {{- $hasVisibleChildren = true }} {{- break }} {{- end }} {{- end }} {{- $title := partial "title.gotmpl" (dict "page" . "linkTitle" true) }} {{- $url := partial "permalink.gotmpl" (dict "to" .) }} {{- $isCrosslink := false }} {{- $target := "" }} {{- if .Params.menuPageRef }} {{- with site.Home.GetPage (.Params.menuPageRef) }} {{- $url = partial "permalink.gotmpl" (dict "to" .) }} {{- $isCrosslink = true }} {{- end }} {{- else if .Params.menuUrl }} {{- $url = .Params.menuUrl }} {{- $isCrosslink = true }} {{- $u := urls.Parse $url }} {{- if $u.IsAbs }} {{- $target = "_blank" }} {{- if isset site.Params "externallinktarget" }} {{- $target = site.Params.externalLinkTarget }} {{- end }} {{- end }} {{- end }} {{- $pre := partial "menu-pre.html" . }} {{- $post := partial "menu-post.html" . }} {{- if and $hasVisibleChildren (not $isCrosslink) }} {{- $isCollapsible := .Params.collapsibleMenu | default site.Params.collapsibleMenu }} {{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }} {{- if and (not $url) (not $isCollapsible) }} {{- $currentAlwaysopen = true }} {{- end }} {{- $entryId := md5 .Path }} {{- $isOpen := or $currentAlwaysopen $isSelf $isAncestor }}