Skip to content

Commit

Permalink
fix: Show section (topmost item) in doc nav header
Browse files Browse the repository at this point in the history
  • Loading branch information
strogonoff committed Dec 10, 2018
1 parent d292aa6 commit 72c5aaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _includes/project-doc-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
{% assign num_nav_sections = nav.sections | size %}

{% for item in nav.items %}
{% assign topmost_item = item %}

{% if page.url == item.path %}
{% assign selected_item = item %}
{% assign selected_section = item %}
{% endif %}

{% if item.items %}
{% for item in item.items %}
{% if page.url == item.path %}
{% assign selected_item = item %}
{% assign selected_section = topmost_item %}
{% endif %}
{% endfor %}
{% endif %}
Expand All @@ -20,7 +24,7 @@
<header class="sidebar-header">
<h3 class="title">
<a href="javascript: void 0;">
{{ include.header_main }}: {{ selected_section.name }}
{{ include.header_main }}{% if selected_section %}: {{ selected_section.title }}{% endif %}
</a>
</h3>

Expand Down

0 comments on commit 72c5aaf

Please sign in to comment.