<aside role="menu">
  {% for category in site.data.guide_categories %}
  {% assign guides = site.guides | where: "category", category.slug | sort:"weight" %}
  <details {% for guide in guides %}{% if guide.url == page.url %}open{% endif %}{% endfor %}>
    <summary>{{ category.name }}</summary>

    <div>
      {% for guide in guides %}
      <a
      role="menuitem"
      {% if page.url == guide.url %}class="active"{% endif %}
      href="{{ guide.url }}"
      ><span>{{ guide.nav_title }}</span></a>
      {% endfor %}
    </div>
  </details>
  {% endfor %}
</aside>
