{% import "partials/language.html" as lang %} {% set toc_ = page.toc %} {% if toc_ | first is defined and "\x3ch1 id=" in page.content %} {% set toc_ = (toc_ | first).children %} {% endif %} {% if toc_ | first is defined %} {{ lang.t('toc.title') }} {% for toc_item in toc_ %} {% include "partials/toc-item.html" %} {% endfor %} {% endif %}