{% macro toc(page, header, language_strings="") %}

{%- set toc_levels = page.extra.toc_levels | default(value=3) -%}

{% if page.extra.toc_ignore_pattern %}
    {%- set toc_ignore_pattern = page.extra.toc_ignore_pattern -%}
{% endif %}

<div class="toc-container">
    {% if header %}
        <h3>{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</h3>
    {% endif %}

    <ul>
        {% for h1 in page.toc %}
            {# Only render 