Skip to content

Commit c070820

Browse files
committed
Selectively activating submenus depending on current top-level menu.
Signed-off-by: Ralph Lange (CR/AEE1) <ralph.lange@de.bosch.com>
1 parent 58b47b0 commit c070820

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

_data/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
- overview/hardware
55
- overview/comparison
66

7-
- title: Tutorials - Basic
7+
- title: Basic Tutorials
88
docs:
99
- tutorials/getting_started
1010
- tutorials/getting_started_embedded
1111
- tutorials/getting_started_simulator
1212

13-
- title: Tutorials - Advanced
13+
- title: Advanced Tutorials
1414
docs:
1515
- tutorials/advanced/nuttx_getting_started
1616
- tutorials/advanced/debugging-gdb-openocd

_includes/docs_nav.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
22
{% for section in site.data.docs %}
3+
{% assign should_show_this_menu = false %}
4+
{% if page.path contains "_docs/overview" and section.title contains "Overview" %}
5+
{% assign should_show_this_menu = true %}
6+
{% endif %}
7+
{% if page.path contains "_docs/tutorials" and section.title contains "Tutorials" %}
8+
{% assign should_show_this_menu = true %}
9+
{% endif %}
10+
{% if page.path contains "_docs/concepts" and section.title contains "Concepts" %}
11+
{% assign should_show_this_menu = true %}
12+
{% endif %}
13+
{% if should_show_this_menu == true %}
314
<div class="panel panel-default">
415
<div class="panel-heading">
516
<h4 class="panel-title">
@@ -18,5 +29,6 @@ <h4 class="panel-title">
1829
</div>
1930
</div>
2031
</div>
32+
{% endif %}
2133
{% endfor %}
2234
</div>

0 commit comments

Comments
 (0)