Compare commits

...

2 Commits

Author SHA1 Message Date
78fadd8f8d Add item count+permalink to each filter.
All checks were successful
Build site / build (push) Successful in 14s
2026-03-13 00:05:53 +05:30
e790cbbea7 Show item count next to each filter label in the sidebar. 2026-03-12 23:52:34 +05:30
3 changed files with 13 additions and 12 deletions

View File

@@ -76,7 +76,7 @@ header {
padding: 0.5rem 0.75rem;
border-bottom: 1px solid var(--color-border);
& h1 { font-size: var(--text-heading); }
& h1 { font-size: var(--text-heading); margin-right: 0.5rem; }
& p { font-size: var(--text-small); }
}
@@ -164,12 +164,9 @@ fieldset {
text-overflow: ellipsis;
& .filter-link {
display: none;
margin-left: auto;
font-size: var(--text-xsmall);
}
&:hover .filter-link { display: inline; }
}
}

View File

@@ -1,8 +1,14 @@
{% macro filter_group(name, label, values, taxonomy) %}
<fieldset>
<legend>{{ label }} <a class="light" data-toggle="{{ name }}">Unselect all</a></legend>
{% for v in values | sort %}
<label><input type="checkbox" name="{{ name }}" value="{{ v }}" data-filter checked> {{ v }}<a class="filter-link light" href="{{ get_taxonomy_url(kind=taxonomy, name=v) }}">View</a></label>
{% set tax = get_taxonomy(kind=taxonomy) %}
{% for term in tax.items | sort(attribute="name") %}
{% if term.name in values %}
<label>
<input type="checkbox" name="{{ name }}" value="{{ term.name }}" data-filter checked> {{ term.name }}
<a class="filter-link" href="{{ term.permalink }}">({{ term.pages | length }})</a>
</label>
{% endif %}
{% endfor %}
</fieldset>
{% endmacro %}

View File

@@ -1,16 +1,14 @@
{% extends "layout.html" %}
{% import "macros.html" as m %}
{% block title %}{{ term.name }} / {{ config.title }}{% endblock %}
{% block title %}{{ term.name }} {{ config.title }}{% endblock %}
{% block meta %}<meta name="description" content="{{ term.name }} - {{ config.description }}">{% endblock %}
{% block subtitle %}
{% if taxonomy.name == "categories" %}
<p><strong>{{ term.name }}</strong> spaces</p>
{% else %}
<p>Spaces in <strong>{{ term.name }}</strong></p>
{% endif %}
<p>
<a href="{{ get_url(path='/') }}">Home</a> / <strong>{{ term.name }}</strong>
</p>
{% endblock %}
{% block sidebar %}