Add option to add table of contents to link group tabs

This commit is contained in:
Helen Chong 2024-12-09 12:51:58 +08:00
parent 120574cbb9
commit eed25c1a94
1 changed files with 11 additions and 6 deletions

View File

@ -27,14 +27,19 @@ isContentDivided: true
<article class="tabwrap">
{% for group in linkGroups %}
<section id="{{ group.data.title | slugify }}" class="content__section">
{% headingAnchor 2 %}
{{ group.data.title }}
{% endheadingAnchor %}
{% headingAnchor 2 %}{{ group.data.title }}{% endheadingAnchor %}
{% if group.data.toc %}
<h3>Table of Contents</h3>
{{ group.templateContent | toc | safe }}
{% endif %}
{{ group.templateContent | safe }}
{% if group.data.updated %}
<p class="update-info">(This {{ group.data.title }} list was last updated on <time datetime="{{ group.data.updated }}">{{ group.data.updated | formatDate }}</time>)</p>
{% endif %}
<a href="#linktabs" class="tab__btn tab__back">Back to tabs</a>
</section>
{%- endfor %}