{% from "macros/question.html" import render_question %}
{% macro render_topic(item, alternative) %}
{% set b_alt = 'topics+'+alternative %}
{% set t = bag(b_alt, item._id) %}
<div class="item">
  <h3 class="text-primary">
    <a href="{{ t.path }}" role="button"></a>
  </h3>
  <div id="{{ t.control }}" role="tabpanel" data-parent="#topics" class="anchor-spacer">
    <div id="{{ t.control }}Accordion" data-children=".question">
      <h1 class="mb-3 p-0 {{ bag('alternatives', alternative, 'direction') }}">{{ item.title }}</h1>
      {% for q in site.query(item.path).include_undiscoverable(true) %}
        {{ render_question(q, item._id, alternative) }}
      {% endfor %}
    </div>
  </div>
</div>
{% endmacro %}
