{% for subs in topSection.subsections %}
{% set sect = get_section(path=subs) %}
{% if not sect.extra.hidden %}
{# Use the first page of a section with sub pages as the section link target. #}
{% if sect.pages | length > 0 %}
{% set permlink = sect.pages[0].permalink %}
{% else %}
{% set permlink = sect.permalink %}
{% endif %}
{% endblock sidebarItems %}
{% block mainContent %}
{% if section is defined %}
{{ section.content | safe }}
{% endif %}
{%if page is defined %}
{{ page.content | safe }}
{% endif %}
{% if section is defined and section.extra.page_list %}