joshua.seigler.net/site/_includes/collection.njk
2025-06-29 16:51:06 -04:00

25 lines
No EOL
781 B
Text

---
layout: "base.njk"
eleventyComputed:
title: "{{ page.fileSlug | capitalize }}"
---
{%- from "components/collectionList.njk" import collectionList with context -%}
<main>
<section data-pagefind-body>
{{ content | safe }}
</section>
{% set tag = page.fileSlug %}
{% if collections[tag] %}
{% if tag === "posts" %}
<div style="--totalTags:{{ collections.categories | dictsort | length }}">
{%- for tag, data in collections.categories -%}
<a class="button tag" style="--tagIndex:{{ collections.categories[tag].id }}" href="/tags/{{ tag | slugify }}/">{{ tag }}
<span class="tagCount">{{ data.count }}</span>
</a>
{%- endfor -%}
</div>
{% endif %}
{{ collectionList(tag) }}
{% endif %}
</main>