{%- from 'macros/navigation.html' import render_navigation_item_from_item %}
{%- for block in navigation_blocks %}
<section>
  <h1>{{ block.title }}</h1>
  <nav class="main">
    <ol>
      {%- for item in block.get_items() %}
      {{ render_navigation_item_from_item(item, current_page) }}
      {%- endfor %}
    </ol>
  </nav>
</section>
{%- endfor %}

{%- from 'macros/navigation.html' import render_navigation_item_from_item %}
{%- for block in navigation_blocks %}
  {%- set items = block.get_items() %}
  {%- if items %}
<section>
  <h1>{{ block.title }}</h1>
  <nav class="main">
    <ol>
      {%- for item in items %}
      {{ render_navigation_item_from_item(item, current_page) }}
      {%- endfor %}
    </ol>
  </nav>
</section>
  {%- endif %}
{%- endfor %}

Hide navigation blocks in which no item would be shown.
Hide navigation blocks in which no item would be shown.
