{# To trigger whether the TOC and its button show up #}
{% set page_toc = generate_toc_html() %}
{% from "../macros/buttons.html" import render_funcs with context %}
{%- for button in header_buttons -%}
{{ render_funcs[button.pop("type")](**button) }}
{%- endfor -%}
{% if page_toc -%}
{%- endif %}