Skip to content

Commit

Permalink
Change logic
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Jan 21, 2025
1 parent 11c9f44 commit f0613f2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/dev/tools/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ images:
"/tutorials/try-viam-sdk/image1.gif",
]
description: "Build a machine yourself by following along with a tutorial."
no_list: true
# no_list: true
hide_children: true
sitemap:
priority: 1.0
Expand Down
5 changes: 2 additions & 3 deletions docs/tutorials/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ linkTitle: "Tutorials"
weight: 300
type: docs
layout: "empty"
hide_children: true
# hide_children: true
sitemap:
priority: 1.0
toc_hide: true
canonical: "/dev/tools/tutorials/"
toc_hide: false
outputs:
- rss
- html
Expand Down
31 changes: 20 additions & 11 deletions layouts/partials/sidebar-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@
{{ $toc_hide := $s.Params.toc_hide -}}
{{ $openOnDesk := $s.Params.open_on_desktop }}
{{ $headerOnly := $s.Params.header_only }}

{{ warnf "1!%s %s %s" $p $p.Section}}

{{ if eq $p.Section "tutorials"}}
<!-- If this is a tutorial -->
<a href="/dev/tools/tutorials/" target="{{ . }}" rel="noopener" class="">
<span> Tutorials </span>
</a>
<li class="active-path tutorial-heading">
<a href="" title="{{ $p.Title }}" class="active">{{ $p.LinkTitle }}
</a>
<div class="td-toc" id="TableOfContents"></div>
</li>

{{ warnf "2!%s" $p }}

{{ else }}

{{ if or (not $toc_hide) ($activePath)}}
<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 }}" >
{{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}}
Expand All @@ -77,9 +95,6 @@
{{ if $s.Params.canonical }}<i class="fas fa-external-link-alt fa-sm"></i>{{ end }}
</a>
{{ else }}
<a href="/dev/tools/tutorials/" target="{{ . }}" rel="noopener" class="">
<span> Tutorials </span>
</a>
{{ end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -113,13 +128,6 @@
{{- end }}
{{- if $withChild }}
{{- if $hideChildren -}}
{{ if eq $p.Section "tutorials" }}
<li class="active-path tutorial-heading">
<a href="" title="{{ $p.Title }}" class="active">{{ $p.LinkTitle }}
</a>
<div class="td-toc" id="TableOfContents"></div>
</li>
{{ end }}
{{- else -}}
{{- $ulNr := add $ulNr 1 }}
<ul class="ul-{{ $ulNr }}">
Expand All @@ -131,4 +139,5 @@
{{- end }}
</li>
{{- end }}
{{- end }}
{{- end }}
{{- end}}

0 comments on commit f0613f2

Please sign in to comment.