43
43
{{ $activePath := and (not $shouldDelayActive) (or ($p.IsDescendant $s) (eq $p $s)) -}}
44
44
{{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (not $p.Site.Params.ui.sidebar_menu_compact) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))) true false -}}
45
45
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}}
46
- {{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}}
46
+ {{ $pages_tmp := (union $s.Pages $s.Sections).ByWeight -}}
47
47
{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}}
48
48
{{ $withChild := gt (len $pages) 0 -}}
49
49
{{ $hideChildren := cond (isset $s.Params "hide_children") true false -}}
50
50
{{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}}
51
51
{{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}}
52
52
{{ $empty_node := $s.Params.empty_node -}}
53
+ {{ $toc_hide := $s.Params.toc_hide -}}
53
54
{{ $openOnDesk := $s.Params.open_on_desktop }}
54
55
{{ $headerOnly := $s.Params.header_only }}
56
+
57
+ {{ if eq $p.Section "tutorials"}}
58
+ <!-- If this is a tutorial -->
59
+ < a href ="/dev/tools/tutorials/ " target ="{{ . }} " rel ="noopener " class ="">
60
+ < span > Tutorials </ span >
61
+ </ a >
62
+ < li class ="active-path tutorial-heading ">
63
+ < a href ="" title ="{{ $p.Title }} " class ="active "> {{ $p.LinkTitle }}
64
+ </ a >
65
+ < div class ="td-toc " id ="TableOfContents "> </ div >
66
+ </ li >
67
+ {{ else }}
68
+
69
+ {{ if or ( or (not $toc_hide) ($activePath) ) $active }}
55
70
< li class ="{{ if $withChild }}nav-fold{{ end }}{{ if $activePath }} active-path{{ else }}{{ if $p.Parent }} hide-if-desktop{{ end }}{{ end }}{{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} {{ if not $activePath }}collapse{{ end }}{{ end }}{{ if $empty_node }} empty-node-submenu{{ end }}{{if $s.Params.menuindent }} indent{{ end }}{{ if $openOnDesk }} open-on-desktop{{ end }}{{ if $headerOnly }} header-only{{ end }} " >
56
71
{{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}}
57
72
< input type ="checkbox " id ="{{ $mid }}-check "{{ if $activePath}} checked{{ end }} />
60
75
{{ else -}}
61
76
{{- if $withChild }}
62
77
< span >
63
- {{ if $empty_node }}
64
- <!-- IF EMPTY NODE WITH CHILDREN -->
65
- < span class ="emptynode {{ if $active}}active{{ end }} {{ if $treeRoot }} tree-root{{ end }} "> {{ $s.LinkTitle }}</ span >
66
- {{ else }}
67
- {{ if not (eq $s.LinkTitle "Tutorials") }}
68
- < a href ="{{ $manualLink }} "{{ if ne $s.LinkTitle $manualLinkTitle }} title ="{{ $manualLinkTitle }} "{{ end }}{{ with $s.Params.manualLinkTarget }} target ="{{ . }} "{{ if eq . "_blank" }} rel="noopener "{{ end }}{{ end }} class ="{{ if $active}} active{{ end }}{{ if $treeRoot }} tree-root{{ end }} ">
69
- {{ if $s.Params.overview }}
70
- < span class ="section-overview "> Overview </ span > < span class ="section-overview-title "> {{ $s.LinkTitle }} </ span >
78
+ {{ if or (not $toc_hide) ($activePath)}}
79
+ {{ if $empty_node }}
80
+ <!-- IF EMPTY NODE WITH CHILDREN -->
81
+ < span class ="emptynode {{ if $active}}active{{ end }} {{ if $treeRoot }} tree-root{{ end }} "> {{ $s.LinkTitle }}</ span >
82
+ {{ else }}
83
+ {{ if not (eq $s.LinkTitle "Tutorials") }}
84
+ < a href ="{{ $manualLink }} "{{ if ne $s.LinkTitle $manualLinkTitle }} title ="{{ $manualLinkTitle }} "{{ end }}{{ with $s.Params.manualLinkTarget }} target ="{{ . }} "{{ if eq . "_blank" }} rel="noopener "{{ end }}{{ end }} class ="{{ if $active}} active{{ end }}{{ if $treeRoot }} tree-root{{ end }} ">
85
+ {{ if $s.Params.overview }}
86
+ < span class ="section-overview "> Overview </ span > < span class ="section-overview-title "> {{ $s.LinkTitle }} </ span >
87
+ {{ else }}
88
+ < span > {{ $s.LinkTitle }} </ span >
89
+ {{ end }}
90
+ {{ if $s.Params.canonical }}< i class ="fas fa-external-link-alt fa-sm "> </ i > {{ end }}
91
+ </ a >
71
92
{{ else }}
72
- < span > {{ $s.LinkTitle }} </ span >
73
93
{{ end }}
74
- {{ if $s.Params.canonical }}< i class ="fas fa-external-link-alt fa-sm "> </ i > {{ end }}
75
- </ a >
76
- {{ end }}
94
+ {{- end }}
77
95
{{- end }}
78
96
{{- if (or (and $withChild (not $treeRoot) ) (not $hideChildren) ) }}
79
97
{{- if (or $hideChildren $treeRoot) -}}
104
122
{{ end }}
105
123
{{- end }}
106
124
{{- if $withChild }}
107
- {{- if $hideChildren -}}
125
+ {{- if and ( $hideChildren) (not $activePath) -}}
108
126
{{- else -}}
109
127
{{- $ulNr := add $ulNr 1 }}
110
128
< ul class ="ul-{{ $ulNr }} ">
115
133
{{- end }}
116
134
{{- end }}
117
135
</ li >
118
- {{- end }}
136
+ {{- end }}
137
+ {{- end }}
138
+ {{- end}}
0 commit comments