释放双眼,带上耳机,听听看~!
{%- for link in section.settings.menu.links -%}
<accordion-disclosure class="accordion">
{% assign link_title_downcase = link.title | downcase %}
{% assign page_title_downcase = collection.title | downcase %}
{% assign should_expand = false %}
{% for child_link in link.links %}
{% assign child_title_downcase = child_link.title | downcase %}
{% if child_title_downcase == page_title_downcase %}
{% assign should_expand = true %}
{% break %}
{% endif %}
{% endfor %}
{% comment %}子菜单名字与页面一样是为真{% endcomment %}
<details class="accordion__disclosure group" {{ page_title_downcase }} {% if link_title_downcase == page_title_downcase or should_expand %}open aria-expanded="true"{% else %}aria-expanded="false"{% endif %}>
<summary>
<span class="accordion__toggle h6">
<span><a href="{{ link.url }}">{{ link.title }}</a></span>
<span class="animated-plus group-expanded:rotate" aria-hidden="true"></span>
</span>
</summary>
<div class="accordion__content">
{%- if link.links != blank -%}
<ul class="v-stack gap-2.5 unstyled-list">
{%- for child_link in link.links -%}
<li>
<a class="link-faded h6" href="{{ child_link.url }}">{{ child_link.title }}</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</div>
</details>
</accordion-disclosure>
{%- endfor -%}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。