|
1 | 1 | --- |
2 | 2 | layout: default |
3 | 3 | --- |
4 | | -<section class="documentation"> |
| 4 | +{% comment %}Determine if a sidebar section matches the current page{% endcomment %} |
| 5 | +{% assign current_section = nil %} |
| 6 | +{% for section in site.data.navigation_sidebar.sections %} |
| 7 | + {% assign _matched = false %} |
| 8 | + {% if section.match_list %} |
| 9 | + {% for m in section.match_list %} |
| 10 | + {% if page.url contains m %}{% assign _matched = true %}{% break %}{% endif %} |
| 11 | + {% endfor %} |
| 12 | + {% elsif section.match %} |
| 13 | + {% if page.url contains section.match %}{% assign _matched = true %}{% endif %} |
| 14 | + {% endif %} |
| 15 | + {% if _matched %}{% assign current_section = section %}{% break %}{% endif %} |
| 16 | +{% endfor %} |
| 17 | +{% assign _has_sidebar = true %} |
| 18 | +{% unless current_section %}{% assign _has_sidebar = false %}{% endunless %} |
| 19 | + |
| 20 | +<section class="documentation{% unless _has_sidebar %} no-sidebar{% endunless %}"> |
| 21 | + {% if _has_sidebar %} |
5 | 22 | <div class="docs-nav-backdrop"></div> |
6 | 23 | <button id="mobile-sidebar-toggle" class="mobile-sidebar-toggle" aria-label="Toggle section navigation"> |
7 | 24 | <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg> |
8 | | - {% assign current_section = nil %} |
9 | | - {% for section in site.data.navigation_sidebar.sections %} |
10 | | - {% assign _matched = false %} |
11 | | - {% if section.match_list %} |
12 | | - {% for m in section.match_list %} |
13 | | - {% if page.url contains m %}{% assign _matched = true %}{% break %}{% endif %} |
14 | | - {% endfor %} |
15 | | - {% elsif section.match %} |
16 | | - {% if page.url contains section.match %}{% assign _matched = true %}{% endif %} |
17 | | - {% endif %} |
18 | | - {% if _matched %}{% assign current_section = section %}{% break %}{% endif %} |
19 | | - {% endfor %} |
20 | 25 | {{ current_section.title }} |
21 | 26 | </button> |
22 | 27 | <nav class="docs-nav" aria-label="Section navigation"> |
23 | 28 | <div class="docs-nav-content"> |
24 | 29 | {% include sidebar-nav.html %} |
25 | 30 | </div> |
26 | 31 | </nav> |
| 32 | + {% endif %} |
27 | 33 | <article> |
28 | 34 | <nav class="hidden lg:flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400 mb-4" aria-label="Breadcrumb" style="text-decoration:none"> |
29 | 35 | <ol class="flex items-center flex-wrap gap-2 list-none p-0 m-0"> |
|
0 commit comments