Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the docs contents menu #9529

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 7 additions & 10 deletions docs/_includes/docs_contents.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<div class="unit one-fifth hide-on-mobiles">
<aside>
{% for section in site.data.docs_nav %}
{% for section in site.data.docs_nav -%}
<h4>{{ section.title }}</h4>
<ul>
{%- for item in section.docs -%}
{%- assign current_page = site.docs | where: "url", item.link | first -%}
{%- capture item_html -%}
<a href="{{ current_page.url | relative_url }}">
{{ current_page.menu_name | default: current_page.title }}
</a>
{% endcapture %}
<li{%- unless current_page.url != page.url -%} class="current"{%- endunless -%}>{{ item_html }}</li>
{% endfor %}
{%- for item in section.docs -%}
{%- assign p = site.docs | where: "url", item.link | first %}
<li {%- if page.url == p.url %} class="current" {%- endif -%}><a href="{{ p.url | relative_url }}">
{{- p.menu_name | default: p.title -}}
</a></li>
{%- endfor %}
</ul>
{% endfor -%}
</aside>
Expand Down