mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-04-19 16:19:16 +00:00
feat(11ty): abstract defintions list into own components
This commit is contained in:
parent
76b3e13991
commit
c41dc6763c
13
11ty/_includes/components/definition.njk
Normal file
13
11ty/_includes/components/definition.njk
Normal 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>
|
3
11ty/_includes/components/defintions-list.njk
Normal file
3
11ty/_includes/components/defintions-list.njk
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% for definition in collections.definedDefinitions %}
|
||||||
|
{% include 'components/definition.njk' %}
|
||||||
|
{% endfor %}
|
@ -34,21 +34,7 @@
|
|||||||
</section>
|
</section>
|
||||||
<section class="auto-grid">
|
<section class="auto-grid">
|
||||||
<h2>Words</h2>
|
<h2>Words</h2>
|
||||||
{% for definition in collections.definitions %}
|
{% include 'components/defintions-list.njk' %}
|
||||||
<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 %}
|
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
Loading…
x
Reference in New Issue
Block a user