1
0
Fork 0
Browse Source

Handle empty tags

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
main
André Jaenisch 2 months ago
parent
commit
3769daac67
Signed by: ryuno-ki
GPG Key ID: 5A668E771F1ED854
  1. 40
      layouts/toolbox-index-page.njk

40
layouts/toolbox-index-page.njk

@ -11,25 +11,27 @@
<ol class="toolbox">
{%- for tool in toolbox | sort -%}
{%- set tags = tool.data.tags | excludeItem('tool') | sort -%}
<li class="tool" data-tags="{{ tags }}">
<p>
<a href="{{ tool.url | url }}">{{ tool.data.title }}</a>
</p>
{%- if tags -%}
<div>
Tagged with
<ul class="tags">
{%- for tag in tags -%}
<li class="tag">
<a href="/tag/{{ tag }}" rel="tag">
{{ tag }}
</a>
</li>
{%- endfor -%}
</ul>
</div>
{%- endif -%}
</li>
{%- if tags | length > 0 -%}
<li class="tool" data-tags="{{ tags }}">
<p>
<a href="{{ tool.url | url }}">{{ tool.data.title }}</a>
</p>
{%- if tags -%}
<div>
Tagged with
<ul class="tags">
{%- for tag in tags -%}
<li class="tag">
<a href="/tag/{{ tag }}" rel="tag">
{{ tag }}
</a>
</li>
{%- endfor -%}
</ul>
</div>
{%- endif -%}
</li>
{%- endif -%}
{%- endfor -%}
</ol>
{%- endif -%}

Loading…
Cancel
Save