-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for multiple first-level sidebar headings (#46)
* Added support for multiple first-level sidebar headings * version bump and adding example of second top level menu Signed-off-by: vsoch <[email protected]> Co-authored-by: vsoch <[email protected]>
- Loading branch information
1 parent
b5f32a1
commit a3e309e
Showing
5 changed files
with
60 additions
and
31 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.0.22 | ||
0.0.23 |
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
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 |
---|---|---|
@@ -1,25 +1,54 @@ | ||
<div id="td-sidebar-menu" class="td-sidebar__inner"> | ||
<div id="td-sidebar-menu" class="td-sidebar__inner"> | ||
|
||
<form class="td-sidebar__search d-flex align-items-center"> | ||
<input type="search" class="form-control td-search-input" placeholder=" Search this site…" aria-label="Search this site…" autocomplete="off"> | ||
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation"> | ||
</button> | ||
<input type="search" class="form-control td-search-input" placeholder=" Search this site…" aria-label="Search this site…" autocomplete="off"> | ||
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation"> | ||
</button> | ||
</form> | ||
|
||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav"> | ||
{% for section in site.data.toc %}<ul class="td-sidebar-nav__section pr-md-3"> | ||
{% capture sectionUrl %}{{ section.url | replace: "/", "" }}{% endcapture %} | ||
{% capture pageUrl %}{{ page.url | replace: "/", "" }}{% endcapture %} | ||
<li class="td-sidebar-nav__section-title"> | ||
<a href="{% if section.url %}{{ site.baseurl }}/{{ section.url }}{% else %}{{ section.external_url }}{% endif %}" class="align-left pl-0 pr-2 active td-sidebar-link td-sidebar-link__section">{{ section.title }}</a> | ||
</li>{% if section.links %}<ul> | ||
<li class="collapse show" id="{{ section.title | slugify }}"> | ||
<ul class="td-sidebar-nav__section pr-md-3">{% for entry in section.links %} | ||
<li class="td-sidebar-nav__section-title"> | ||
<a href="{% if entry.url %}{{ site.baseurl }}/{{ entry.url }}{% else %}{{ entry.external_url }}{% endif %}" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">{{ entry.title }}</a> | ||
</li> | ||
{% if page.url contains entry.url or pageUrl == sectionUrl %} | ||
<ul><li class="collapse show" id="{{ child.title | slugify }}">{% if entry.children %} | ||
{% for child in entry.children %}<a class="td-sidebar-link td-sidebar-link__page " id="m-{{ section.title | slugify }}-{{ entry.title | slugify }}-{{ child.title | slugify }}" href="{% if child.url %}{{ site.baseurl }}/{{ child.url }}{% else %}{{ child.external_url }}{% endif %}">{{ child.title }}</a>{% endfor %} | ||
{% endif %}</li></ul>{% endif %}{% endfor %} | ||
</ul>{% endif %}{% endfor %} | ||
{% for section in site.data.toc %} | ||
<ul class="td-sidebar-nav__section pr-md-3"> | ||
{% capture sectionUrl %} | ||
{{ section.url | replace: "/", "" }} | ||
{% endcapture %} | ||
{% capture pageUrl %} | ||
{{ page.url | replace: "/", "" }} | ||
{% endcapture %} | ||
|
||
<li class="td-sidebar-nav__section-title"> | ||
<a href="{% if section.url %}{{ site.baseurl }}/{{ section.url }}{% else %}{{ section.external_url }}{% endif %}" class="align-left pl-0 pr-2 active td-sidebar-link td-sidebar-link__section">{{ section.title }}</a> | ||
</li> | ||
{% if section.links %} | ||
<ul> | ||
<li class="collapse show" id="{{ section.title | slugify }}"> | ||
<ul class="td-sidebar-nav__section pr-md-3"> | ||
{% for entry in section.links %} | ||
<li class="td-sidebar-nav__section-title"> | ||
<a href="{% if entry.url %} | ||
{{ site.baseurl }}/{{ entry.url }} | ||
{% else %} | ||
{{ entry.external_url }} | ||
{% endif %}" | ||
class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">{{ entry.title }} | ||
</a> | ||
</li> | ||
{% if page.url contains entry.url or pageUrl == sectionUrl %} | ||
<ul> | ||
<li class="collapse show" id="{{ child.title | slugify }}"> | ||
{% if entry.children %} | ||
{% for child in entry.children %} | ||
<a class="td-sidebar-link td-sidebar-link__page " id="m-{{ section.title | slugify }}-{{ entry.title | slugify }}-{{ child.title | slugify }}" href="{% if child.url %}{{ site.baseurl }}/{{ child.url }}{% else %}{{ child.external_url }}{% endif %}">{{ child.title }}</a>{% endfor %} | ||
{% endif %} | ||
</li> | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
</ul> | ||
{% endif %} | ||
</ul> | ||
{% endfor %} | ||
</nav> | ||
</div> |