Simplify assigning classname to docs' aside-links (#7609)
Merge pull request 7609
This commit is contained in:
parent
9957e21be7
commit
079b7231d9
|
@ -5,11 +5,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for item in section.docs %}
|
{% for item in section.docs %}
|
||||||
{% assign p = site.documents | where: "url", item.link | first %}
|
{% assign p = site.documents | where: "url", item.link | first %}
|
||||||
<li class="{% if p.url == '/docs/' %}
|
<li {%- if page.url == p.url %} class="current" {%- endif %}>
|
||||||
{% if page.url == '/docs/' %}current{% endif %}
|
|
||||||
{% else %}
|
|
||||||
{% if page.url contains p.url %}current{% endif %}
|
|
||||||
{% endif %}">
|
|
||||||
<a href="{{ p.url }}">
|
<a href="{{ p.url }}">
|
||||||
{{ p.menu_name | default: p.title }}
|
{{ p.menu_name | default: p.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in New Issue