Add homepage tag discovery matrix
Deploy production / deploy (push) Successful in 21s

This commit is contained in:
2026-08-23 16:51:54 -07:00
parent fe6025fa63
commit 623686590c
6 changed files with 244 additions and 5 deletions
+2 -2
View File
@@ -10,8 +10,8 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500&family=Playfair+Display:ital,wght@0,600;0,700;1,500;1,600&display=swap" rel="stylesheet">
<link rel="icon" href="{{ '/static/favicon.svg'|url }}" type="image/svg+xml">
<link rel="stylesheet" href="{{ '/static/style.css'|url }}?v=23">
<script src="{{ '/static/tags.js'|url }}?v=1" defer></script>
<link rel="stylesheet" href="{{ '/static/style.css'|url }}?v=24">
<script src="{{ '/static/tags.js'|url }}?v=2" defer></script>
<script src="{{ '/static/activity.js'|url }}?v=1" defer></script>
<script src="{{ '/static/hero-circuit.js'|url }}?v=2" defer></script>
<script src="{{ '/static/section-heroes.js'|url }}?v=1" defer></script>
+47
View File
@@ -181,3 +181,50 @@
</div>
</div>
</section>
{% set tracked_tags = site.get('/tags').children %}
<section class="homepage-tag-section" aria-labelledby="homepage-tag-heading" data-tag-matrix>
<div class="shell">
<div class="homepage-tag-header">
<div>
<p class="eyebrow">Topic map</p>
<h2 id="homepage-tag-heading">Explore the Signal</h2>
<p>A map of the topics that keep surfacing across Labyricorn. Pick a signal and follow it deeper into the site.</p>
</div>
<p class="homepage-tag-readout"><span aria-hidden="true"></span>{{ tracked_tags.count() }} tracked topics across Labyricorn</p>
</div>
<nav class="tag-matrix" aria-label="Explore content by topic">
{% for tag in tracked_tags %}
{% set usage = namespace(count=0) %}
{% for section_id in ['projects', 'blog', 'articles'] %}
{% for item in site.query('/' ~ section_id) %}
{% set item_tags = item.taxonomy_tags if item._model == 'project' else item.tags %}
{% if tag._id in item_tags %}{% set usage.count = usage.count + 1 %}{% endif %}
{% endfor %}
{% endfor %}
{% for project in site.query('/projects') %}
{% if project._model == 'project' %}
{% set devlog = site.get(project.path ~ '/devlog') %}
{% if devlog %}
{% for entry in devlog.children %}
{% if tag._id in entry.topic_tag_slugs %}{% set usage.count = usage.count + 1 %}{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% set weight = 4 if usage.count >= 8 else (3 if usage.count >= 4 else (2 if usage.count >= 2 else 1)) %}
<a class="tag-matrix-link tag-matrix-level-{{ weight }}" href="{{ tag|url }}" rel="tag" data-tag-title="{{ tag.title }}" data-tag-summary="{{ tag.summary|striptags|trim }}">
<span class="tag-matrix-name">{{ tag.title }}</span>
<span class="tag-matrix-count" aria-hidden="true">{{ usage.count }}</span>
<span class="visually-hidden"> — {{ usage.count }} published {% if usage.count == 1 %}entry{% else %}entries{% endif %}</span>
</a>
{% endfor %}
</nav>
<div class="tag-matrix-summary" aria-live="polite" aria-atomic="true">
<span class="tag-matrix-summary-label">Tag Summary</span>
<p><strong data-tag-summary-title>Preview a topic</strong><span data-tag-summary-text>Hover or focus a topic to preview it. Select a topic to open its archive.</span></p>
</div>
</div>
</section>