feat(11ty): only render flag in ToC if type is defined

some defintions might be flagged as avoid without being further specified, in this case no flag should be rendered in the table of content
This commit is contained in:
Oscar 2019-11-15 21:22:09 +01:00
parent f8469baf5f
commit fad87004ce

View File

@ -4,7 +4,10 @@
{% for definition in collections.definitions %}
{% set renderedName %}
{{ definition.data.title}}
{%- if definition.data.flag and (definition.data.flag.level == 'avoid') -%}
{%- if
definition.data.flag and
definition.data.flag.type and
(definition.data.flag.level == 'avoid') -%}
<span class="flag__red">{{ definition.data.flag.type }}</span>
{% endif %}
{% endset %}