feat(11ty): abstract defintions list into own components

This commit is contained in:
Oscar 2019-11-12 01:17:50 +01:00
parent 76b3e13991
commit c41dc6763c
3 changed files with 18 additions and 16 deletions

View File

@ -0,0 +1,13 @@
<article id={{ definition.data.slug }}>
<h3>{{ definition.data.title}}</h3>
<p>{{ definition.data.flag }}</p>
{# <p>{{ definition.data.alt_words }}</p> #}
{%- if definition.data.alt_words -%}
<h4>Alt words</h4>
<ul class="list-semicolon">
{% for word in definition.data.alt_words %}
<li>{{ word }}</li>
{% endfor %}
</ul>
{% endif %}
</article>

View File

@ -0,0 +1,3 @@
{% for definition in collections.definedDefinitions %}
{% include 'components/definition.njk' %}
{% endfor %}

View File

@ -34,21 +34,7 @@
</section>
<section class="auto-grid">
<h2>Words</h2>
{% for definition in collections.definitions %}
<article id={{ definition.data.slug }}>
<h3>{{ definition.data.title}}</h3>
<p>{{ definition.data.flag }}</p>
{# <p>{{ definition.data.alt_words }}</p> #}
{%- if definition.data.alt_words -%}
<h4>Alt words</h4>
<ul class="list-semicolon">
{% for word in definition.data.alt_words %}
<li>{{ word }}</li>
{% endfor %}
</ul>
{% endif %}
</article>
{% endfor %}
{% include 'components/defintions-list.njk' %}
</section>
</main>
</body>
</body>