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