selfdefined/11ty/_includes/components/table-of-content-item.njk
Tatiana Mac 878b474f32 ⚠️ Add flag design for content warning (#120)
* ⚠️ Add flag design for content warning

* Fix build error

* Lol fix build error

* Added terms
2020-05-09 20:13:45 -07:00

24 lines
851 B
Plaintext

<li class="toc__list-item">
{{ definition.data.title | linkIfExistsInCollection(collections.definedWords) | safe }}
{%- if
definition.data.flag and
definition.data.flag.text and
(definition.data.flag.level == 'avoid') -%}
<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 %}
{%- if definition.data.sub_terms -%}
<ul class="sub-terms" role="list" aria-label="{{definition.data.title}}">
{% for term in definition.data.sub_terms %}
<li
class="subterm"
>{{ term | linkSubTermIfDefined(collections.definedWords) | safe }}</li>
{% endfor %}
</ul>
{% endif %}
</li>