mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-01-23 01:40:10 +00:00
feat(11ty): use linkTarget filter && flag object structure
This commit is contained in:
parent
1295cb309b
commit
415f2aba61
@ -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>
|
||||||
|
<div class="auto-grid list">
|
||||||
<ul>
|
<ul>
|
||||||
{% for definition in collections.definitions %}
|
{% for definition in collections.definitions %}
|
||||||
{% set renderedName %}
|
{% set renderedName %}
|
||||||
{{ definition.data.title}}
|
{{ definition.data.title}}
|
||||||
{%- if definition.data.flag and (definition.data.flag_type == 'avoid') -%}
|
{%- if definition.data.flag and (definition.data.flag.level == 'avoid') -%}
|
||||||
<span class="flag__red">{{ definition.data.flag}}</span>
|
<span class="flag__red">{{ definition.data.flag.type }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endset %}
|
{% endset %}
|
||||||
<li>
|
<li>
|
||||||
{%- if definition.data.alt_words -%}
|
{%- if definition.data.defined -%}
|
||||||
{% set linkTarget %}
|
<a
|
||||||
#{{ definition.data.slug }}
|
href={{ definition.data.slug | linkTarget | url }}
|
||||||
{% endset %}
|
class="word__link"
|
||||||
<a href={{ linkTarget }}>{{ renderedName | safe }}</a>
|
>{{ renderedName | safe }}</a>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{ renderedName }}
|
{{ renderedName | safe }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h2>Words</h2>
|
<h2>Words</h2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user