Skip to content

Commit d370dd9

Browse files
committed
quick fix for navigation, not perfect but shows something
Signed-off-by: Vanessa Sochat <[email protected]>
1 parent c823d54 commit d370dd9

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

_includes/sidebar.html

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,45 @@
1717
<ul class="md-nav__list" data-md-scrollfix="">
1818
<li class="md-nav__item md-nav__item--active">
1919
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" id="__toc" type="checkbox">
20-
<label class="md-nav__link md-nav__link--active" for="__toc">Home</label>
21-
<a class="md-nav__link md-nav__link--active" href="{{ site.baseurl }}/" title="Home">Home</a>
20+
<label class="md-nav__link md-nav__link--active" for="__toc">Home</label>
21+
<a class="md-nav__link md-nav__link--active" href="{{ site.baseurl }}/" title="Home">Home</a>
2222

2323
<nav class="md-nav md-nav--secondary">
2424
<label class="md-nav__title" for="__toc">Table of contents</label>
2525
<ul class="md-nav__list" data-md-scrollfix="">
26-
2726
{% for section in site.data.toc %}
28-
<li class="md-nav__item {% if forloop.first%}{% else %}md-nav__item--nested{% endif %}">
29-
<a class="md-nav__link" href="#{{ section.title | slugify }}"
27+
<li class="md-nav__item">
28+
<a class="md-nav__link" href="{{ site.baseurl }}/{{ section.url }}"
3029
id="pancakes-{{ section.title | slugify }}"
3130
title="{{ section.title }}">{{ section.title }}</a>
32-
{% if section.children %}<nav class="md-nav">
33-
<ul class="md-nav__list">
34-
{% for child in section.children %}<li class="md-nav__item">
35-
<a href="#{{ child.title | slugify }}"
36-
title="{{ child.title }}"
37-
class="md-nav__link child-{{ section.title | slugify }}">{{ child.title }}</a>
38-
</li>{% endfor %}
39-
</ul>
40-
</nav>{% endif %}
4131
</li>
4232
{% endfor %}
4333
</ul>
4434
</nav>
4535
</li>
4636

37+
<!-- This navigation is completely for mobile -->
38+
{% for section in site.data.toc %}<li class="md-nav__item mobile-nav" style="display:none">
39+
<a class="md-nav__link" href="{{ site.baseurl }}/{{ section.url }}" title="{{ section.title }}">{{ section.title }}</a>
40+
</li>{% endfor %}
41+
42+
<!-- This navigation is completely for non mobile -->
4743
{% for section in site.data.toc %}
48-
<li class="md-nav__item md-nav__item--nested">
44+
<li class="md-nav__item md-nav__item--nested not-mobile-nav">
4945
<a class="md-nav__link pancakes-parent" {% if section.children %}href="#pancakes-{{ section.title | slugify }}"{% else %}href="{{ site.baseurl }}/{{ section.url }}"{% endif %}
5046
id="pancakes-{{ section.title | slugify }}"
5147
title="{{ section.title }}">{{ section.title }}</a>
5248
{% if section.children %}<nav class="md-nav">
5349
<ul class="md-nav__list">
5450
{% for child in section.children %}<li class="md-nav__item">
5551
<a href="{{ site.baseurl }}/{{ child.url }}"
56-
title="{{ child.title }}" style="display:none"
52+
title="{{ child.title }}"
5753
class="md-nav__link pancakes-child">{{ child.title }}</a>
5854
</li>{% endfor %}
5955
</ul>
6056
</nav>{% endif %}
61-
</li>
62-
{% endfor %}
57+
</li>{% endfor %}
58+
6359
</ul>
6460
</nav>
6561
</div>

assets/css/main.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,17 @@ html [dir=rtl] .md-search__inner {
23062306
transition: width 0s, height 0s, opacity .25s;
23072307
opacity: 1;
23082308
}
2309+
.not-mobile-nav {
2310+
display: none !important;
2311+
}
2312+
.mobile-nav {
2313+
display: normal !important;
2314+
}
2315+
.md-nav--primary .md-nav__item--nested>.md-nav__link:after {
2316+
content: "" !important}
2317+
[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link:after {
2318+
content: "" !important}
2319+
23092320
.md-header-nav__button.md-icon--home, .md-header-nav__button.md-logo {
23102321
display: none;
23112322
}

0 commit comments

Comments
 (0)