|
18 | 18 |
|
19 | 19 | <ul class="list-unstyled">
|
20 | 20 | {{ $currentPage := . }}
|
21 |
| - {{ range .Site.Menus.main }} |
| 21 | + {{ range $menu }} |
22 | 22 | {{ if .HasChildren }}
|
23 |
| - <li class="nav-top-level {{ if (not (or (in $excludeAsyc .Identifier) (in .URL "api/"))) }} js-load {{ end }} |
| 23 | + <li class="nav-top-level {{ if (not (or (in $excludeAsyc .Identifier) (and (in .URL "api/") (not (in .URL "_api/")) (not (in .URL "-api/"))))) }} js-load {{ end }} |
24 | 24 | {{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
|
25 | 25 | {{ $url_without_anchor = (index (split .URL "#") 0) }}
|
26 | 26 | <a href="{{ .URL | relLangURL }}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}">
|
27 | 27 | {{ if .Pre }}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}{{ end }} <div><span>{{ .Name }}</span></div>
|
28 | 28 | </a>
|
29 |
| - <ul class="list-unstyled sub-menu"> |
| 29 | + <ul class="list-unstyled sub-menu {{ if (or (eq .Name "Guides") (eq .Name "Widgets")) }} d-none {{ end }}"> |
30 | 30 | {{ range .Children }}
|
31 |
| - <li class="{{ if (not (or (in $excludeAsyc .Identifier ) (in .URL "api/"))) }} js-load {{- end -}} {{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"> |
| 31 | + <li class="{{ if (not (or (in $excludeAsyc .Identifier) (and (in .URL "api/") (not (in .URL "_api/")) (not (in .URL "-api/"))))) }} js-load {{ end }} {{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"> |
32 | 32 | {{ $url_without_anchor = (index (split .URL "#") 0) }}
|
33 | 33 | <a href="{{ .URL | relLangURL }}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}">
|
34 | 34 | {{ if .Pre }}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}{{ end }} <span>{{ .Name }}</span>
|
35 | 35 | </a>
|
36 | 36 | {{ if .HasChildren }}
|
37 |
| - <ul class="list-unstyled sub-menu"> |
| 37 | + <ul class="list-unstyled sub-menu {{ if (or (eq .Name "Guides") (eq .Name "Widgets")) }} d-none {{ end }}"> |
38 | 38 | {{ range .Children }}
|
39 |
| - <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }} {{ if (not (or (in $excludeAsyc .Identifier) (in .URL "api/"))) }} js-load {{- end -}}" > |
| 39 | + <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }} {{ if (not (or (in $excludeAsyc .Identifier) (and (in .URL "api/") (not (in .URL "_api/")) (not (in .URL "-api/"))))) }} js-load {{ end }}" > |
40 | 40 | {{ $url_without_anchor = (index (split .URL "#") 0) }}
|
41 | 41 | <a href="{{ .URL | relLangURL }}" data-type="{{- with site.GetPage .URL -}}{{- .Type -}}{{- end -}}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}">
|
42 | 42 | {{ if .Pre }}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}{{ end }} <span>{{ .Name }}</span>
|
43 | 43 | </a>
|
44 |
| - {{/* 4th level, hide */}} |
| 44 | + {{/* 4th level, hide */}} |
45 | 45 | {{ if .HasChildren }}
|
46 | 46 | <ul class="list-unstyled sub-menu d-none">
|
47 | 47 | {{ range .Children }}
|
48 |
| - <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }} {{ if (not (or (in $excludeAsyc .Identifier) (in .URL "api/"))) }} js-load {{- end -}}" > |
| 48 | + <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }} {{ if (not (or (in $excludeAsyc .Identifier) (and (in .URL "api/") (not (in .URL "_api/")) (not (in .URL "-api/"))))) }} js-load {{ end }}" > |
49 | 49 | {{ $url_without_anchor = (index (split .URL "#") 0) }}
|
50 | 50 | <a data-name="{{- delimit (last 1 (split (strings.TrimSuffix "/" .URL) "/")) "" -}}" href="{{ .URL | relLangURL }}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}">
|
51 | 51 | {{ if .Pre }}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}{{ end }} <span>{{ .Name }}</span>
|
|
63 | 63 | </ul>
|
64 | 64 | </li>
|
65 | 65 | {{ else }}
|
66 |
| - <li class="nav-top-level {{ if (not (or (in $excludeAsyc .Identifier) (in .URL "api/"))) }} js-load {{ end }}"> |
| 66 | + <li class="nav-top-level {{ if (not (or (in $excludeAsyc .Identifier) (and (in .URL "api/") (not (in .URL "_api/")) (not (in .URL "-api/"))))) }} js-load {{ end }}"> |
67 | 67 | <a href="{{ .URL | absLangURL }}" data-path="{{ trim (print $branchPath ((print .URL) | relLangURL)) "/" }}">
|
68 | 68 | {{ if .Pre }}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}{{ end }} <div><span>{{ .Name }}</span></div>
|
69 | 69 | </a>
|
|
0 commit comments