-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{% macro docs_sidebar(current_section) %} | ||
<div class="col-lg-5 col-xl-4 docs-sidebar"> | ||
<nav class="docs-links" aria-label="Main navigation"> | ||
{% set index_path = current_section ~ "/_index.md" | trim_start_matches(pat="/") %} | ||
{% set index = get_section(path=index_path) %} | ||
{% if index.pages %} | ||
<ul class="list-unstyled"> | ||
{% for page in index.pages %} | ||
<li><a class="docs-link{% if current_url == page.permalink %} active{% endif %}" href="{{ page.permalink | safe }}">{{ page.title }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% if index.subsections %} | ||
<div class="accordion accordion-flush" id="accordionSubMenu"> | ||
{% for s in index.subsections %} | ||
{% set subsection = get_section(path=s) %} | ||
{% if subsection.pages %} | ||
<div class="accordion-item"> | ||
<h2 class="accordion-header" id="{{ subsection.title | slugify }}"> | ||
{% if subsection.permalink in current_url %} | ||
<a class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{ subsection.title | slugify }}" aria-expanded="true" aria-controls="collapse{{ subsection.title | slugify }}"> | ||
{{ subsection.title }} | ||
</a> | ||
{% else %} | ||
<a class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{ subsection.title | slugify }}" aria-expanded="false" aria-controls="collapse{{ subsection.title | slugify }}"> | ||
{{ subsection.title }} | ||
</a> | ||
{% endif %} | ||
</h2> | ||
<div id="collapse{{ subsection.title | slugify }}" class="accordion-collapse collapse {% if subsection.permalink in current_url %} show {% endif %}" aria-labelledby="{{ subsection.title | slugify }}" {% if subsection.permalink not in current_url %} data-bs-parent="#accordionSubMenu" {% endif %}> | ||
<div class="accordion-body"> | ||
<ul class="list-unstyled"> | ||
{% for page in subsection.pages %} | ||
<li><a class="docs-link{% if current_url == page.permalink %} active{% endif %}" href="{{ page.permalink | safe }}">{{ page.title }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
</nav> | ||
</div> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters