feat(11ty): use linkTarget filter && flag object structure

This commit is contained in:
Oscar 2019-11-12 15:19:12 +01:00
parent 1295cb309b
commit 415f2aba61

View File

@ -21,28 +21,30 @@
<body> <body>
<main> <main>
{{ content | safe }} {{ content | safe }}
<section class="auto-grid"> <section>
<h2>Table of Content</h2> <h2>Table of Content</h2>
<ul> <div class="auto-grid list">
{% for definition in collections.definitions %} <ul>
{% set renderedName %} {% for definition in collections.definitions %}
{{ definition.data.title}} {% set renderedName %}
{%- if definition.data.flag and (definition.data.flag_type == 'avoid') -%} {{ definition.data.title}}
<span class="flag__red">{{ definition.data.flag}}</span> {%- if definition.data.flag and (definition.data.flag.level == 'avoid') -%}
{% endif %} <span class="flag__red">{{ definition.data.flag.type }}</span>
{% endset %} {% endif %}
<li> {% endset %}
{%- if definition.data.alt_words -%} <li>
{% set linkTarget %} {%- if definition.data.defined -%}
#{{ definition.data.slug }} <a
{% endset %} href={{ definition.data.slug | linkTarget | url }}
<a href={{ linkTarget }}>{{ renderedName | safe }}</a> class="word__link"
{%- else -%} >{{ renderedName | safe }}</a>
{{ renderedName }} {%- else -%}
{% endif %} {{ renderedName | safe }}
</li> {% endif %}
{% endfor %} </li>
</ul> {% endfor %}
</ul>
</div>
</section> </section>
<section> <section>
<h2>Words</h2> <h2>Words</h2>