{# Helper to mark active links by endpoint name #} {% macro nav_link(endpoint, text) -%} {%- set href = url_for(endpoint) -%} {%- set active = 'active' if request.endpoint == endpoint else '' -%} {{ text }} {%- endmacro %}