2 |
3 | {{- $currentNode := . -}}
4 |
5 | {{- template "menu-nextprev" dict "menu" .Site.Home "currentnode" $currentNode -}}
6 |
7 | {{- define "menu-nextprev" -}}
8 | {{- $currentNode := .currentnode -}}
9 | {{- if ne .menu.Params.hidden true -}}
10 | {{- if eq $currentNode.Permalink .menu.Permalink -}}
11 | {{- $currentNode.Scratch.Set "NextPageOK" "OK" -}}
12 | {{- $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") -}}
13 | {{- else -}}
14 | {{- if eq ($currentNode.Scratch.Get "NextPageOK") "OK" -}}
15 | {{- $currentNode.Scratch.Set "NextPageOK" nil -}}
16 | {{- $currentNode.Scratch.Set "nextPage" .menu -}}
17 | {{- end -}}
18 | {{- end -}}
19 | {{- $currentNode.Scratch.Set "prevPageTmp" .menu -}}
20 |
21 | {{- if .menu.Sections -}}
22 | {{- $currentNode.Scratch.Set "pages" (.menu.RegularPages | union .menu.Sections) -}}
23 | {{- else -}}
24 | {{- $currentNode.Scratch.Set "pages" .menu.RegularPages -}}
25 | {{- end -}}
26 | {{- $pages := ($currentNode.Scratch.Get "pages") -}}
27 |
28 | {{- range $pages.ByWeight -}}
29 | {{- template "menu-nextprev" dict "menu" . "currentnode" $currentNode -}}
30 | {{- end -}}
31 | {{- end -}}
32 | {{- end -}}
33 |
34 |
35 | {{- if not $.Site.Params.disableNavChevron -}}
36 | {{- with ($.Scratch.Get "prevPage") -}}
37 |
38 | {{ end -}}
39 | {{- with ($.Scratch.Get "nextPage") -}}
40 |
41 | {{- end }}
42 | {{- end -}}
43 |
44 |
--------------------------------------------------------------------------------
/doc/layouts/partials/docdock/tree-of-menu.html:
--------------------------------------------------------------------------------
1 | {{- $currentPage := . }}
2 |
3 | {{- range .Site.Menus.main.ByWeight -}}
4 | {{- template "menu-item" dict "menuEntry" . "currentPage" $currentPage -}}
5 | {{- end -}}
6 |
7 | {{- define "menu-item" -}}
8 | {{- $currentPage := .currentPage -}}
9 | {{- $showvisitedlinks := .Site.Params.showVisitedLinks -}}
10 | {{- with .menuEntry -}}
11 | {{- $menuEntry := . -}}
12 | {{- $isCurrent := $currentPage.IsMenuCurrent .Menu . -}}
13 | {{- $isAncestor := $currentPage.HasMenuCurrent .Menu . -}}
14 | {{- $children := .Children -}}
15 | {{- $numberOfChildren := (len $children) }}
16 |
17 | {{- if ne $numberOfChildren 0 -}}
18 | {{- if ne .Page nil -}}
19 | {{- with .Page -}}
20 | {{- $alwaysOpen := .Params.alwaysopen -}}
21 |