selfdefined/11ty/_includes/components/table-of-content-item.njk

24 lines
851 B
Plaintext
Raw Normal View History

<li class="toc__list-item">
{{ definition.data.title | linkIfExistsInCollection(collections.definedWords) | safe }}
{%- if
definition.data.flag and
2019-11-17 22:28:31 +01:00
definition.data.flag.text and
(definition.data.flag.level == 'avoid') -%}
2019-11-17 22:28:31 +01:00
<span class="flag__red">{{ definition.data.flag.text }}</span>
{%- elseif
definition.data.flag and
definition.data.flag.text and
(definition.data.flag.level == 'warning') -%}
<span class="flag__yellow">{{ definition.data.flag.text }}</span>
{% endif %}
2019-11-17 18:27:47 +01:00
{%- if definition.data.sub_terms -%}
<ul class="sub-terms" role="list" aria-label="{{definition.data.title}}">
2019-11-17 18:27:47 +01:00
{% for term in definition.data.sub_terms %}
<li
class="subterm"
>{{ term | linkSubTermIfDefined(collections.definedWords) | safe }}</li>
2019-11-17 18:27:47 +01:00
{% endfor %}
</ul>
{% endif %}
</li>