Skip to content

Commit

Permalink
Mark guides/api links active when in sub pages
Browse files Browse the repository at this point in the history
Fixes #156
  • Loading branch information
xPaw committed Nov 6, 2018
1 parent 5f3c508 commit e32828f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions _includes/menu.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% assign current_path = page.url | split: '/' %}
{% assign docs = (site.docs | sort: "order" ) %}
{% for node in docs %}
{% assign level = (node.relative_path | split: '/' | size) %}
{% if level == 2 # Not a subfolder %}
{% assign path = node.url | split: '/' %}
{% assign level = path | size %}
{% if level == 3 # Not a subfolder %}
<li>
<a
href="{{ site.baseurl }}{{ node.url | remove: "/index" }}"
{% if page.url == node.url %}class="active"{% endif %}
{% if page.url == node.url or current_path[2] == path[2] %}class="active"{% endif %}
>
{{ node.title }}
</a>
Expand Down

0 comments on commit e32828f

Please sign in to comment.