feat: allow customizable heading levels for details summary

This commit is contained in:
madrilene 2025-10-24 12:49:30 +02:00
parent 55ab760eb4
commit 66e042825f

View file

@ -1,3 +1,5 @@
{% set headingLevel = headingLevel | default(false) %}
<div class="details flow">
<div class="control | cluster" aria-label="{{ meta.details.aria }}">
<button id="expandAll" class="button" data-small-button>{{ meta.details.expand }}</button>
@ -5,7 +7,13 @@
</div>
{%- for item in itemList | alphabetic -%}
<details id="{{ item.data.title | slugify }}">
<summary>{{ item.data.title }}</summary>
<summary>
{%- if headingLevel -%}
<{{ headingLevel }}>{{ item.data.title }}</{{ headingLevel }}>
{%- else -%}
{{ item.data.title }}
{%- endif -%}
</summary>
{{- item.templateContent | safe -}}
</details>
{%- endfor -%}