From fad87004ce98cd00c27ad628e9253bbc812ceef1 Mon Sep 17 00:00:00 2001 From: Oscar Date: Fri, 15 Nov 2019 21:22:09 +0100 Subject: [PATCH] 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 --- 11ty/_includes/components/table-of-content.njk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/11ty/_includes/components/table-of-content.njk b/11ty/_includes/components/table-of-content.njk index 0b6870fb..fce259b5 100644 --- a/11ty/_includes/components/table-of-content.njk +++ b/11ty/_includes/components/table-of-content.njk @@ -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') -%} {{ definition.data.flag.type }} {% endif %} {% endset %}