| <!-- | |
| Licensed to the Apache Software Foundation (ASF) under one | |
| or more contributor license agreements. See the NOTICE file | |
| distributed with this work for additional information | |
| regarding copyright ownership. The ASF licenses this file | |
| to you under the Apache License, Version 2.0 (the | |
| "License"); you may not use this file except in compliance | |
| with the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, | |
| software distributed under the License is distributed on an | |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| KIND, either express or implied. See the License for the | |
| specific language governing permissions and limitations | |
| under the License. | |
| --> | |
| {# Start the sidebar from the deepest captioned section the page lives under: | |
| - user-guide/* (any version, including the index itself) always anchors | |
| at user-guide/index (depth 1) and nests each version's own captioned | |
| groups inside that version's accordion (see user_guide_sidebar_html in | |
| conf.py), so the same version-accordion tree stays visible and stable | |
| across every User Guide page — only the "current" highlighting and | |
| which accordion is expanded change. | |
| - contributor-guide/* lives under contributor-guide/index.md, so start at depth 1 | |
| - root and orphan pages (search, genindex) fall back to the global toctree (depth 0). | |
| user_guide_versioned additionally requires a real depth-1 ancestor to | |
| exist, so orphan pages under user-guide/ (not reachable from any | |
| toctree) fall through to the depth-0 global fallback below instead of | |
| crashing generate_toctree_html. #} | |
| {% set user_guide_versioned = pagename.startswith("user-guide/") and not suppress_sidebar_toctree(startdepth=1, includehidden=True) %} | |
| {% if user_guide_versioned %} | |
| {% elif not suppress_sidebar_toctree(startdepth=1, includehidden=True) %} | |
| {% set sidebar_startdepth = 1 %} | |
| {% else %} | |
| {% set sidebar_startdepth = 0 %} | |
| {% endif %} | |
| <nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation"> | |
| <div class="bd-toc-item active"> | |
| {% if user_guide_versioned %} | |
| {{ user_guide_sidebar_html() }} | |
| {% else %} | |
| {{ generate_toctree_html("sidebar", startdepth=sidebar_startdepth, maxdepth=4, collapse=False, includehidden=True, titles_only=True) }} | |
| {% endif %} | |
| </div> | |
| </nav> |