Faceted tag filter on category pages
Faceted tag filter on category pages
#25 in Riparion/riparion-cms — merged 2026-06-01
Summary
- Picking a tag inside
/category/:slugnow narrows results within that category instead of switching to the global tag feed. - The sidebar tag list is scoped to tags that actually appear on published posts in the category — it can no longer expand the visible set.
- New
list_tags_for_categoryserver fn does a DISTINCT join overtags/post_tags/posts/categories(published-only). - Route is now
/category/:slug?:tag;CategoryFeedreads the query and passes it throughPaginatedFeed+ the title.TagList/TagPilltake an optionalcategory_slugand toggle the active pill off on click. Outside a category, behavior is unchanged. - Breadcrumb shows a
#tagcrumb under the category when a facet is active; clicking the category clears it.
Test plan
-
dx serve, visit/category/foo— sidebar shows only tags present on foo's published posts. - Click a tag — URL becomes
/category/foo?tag=…, feed narrows to the intersection, pill highlights. - Click the active pill — facet clears, full category feed returns.
- Click the category name in the breadcrumb while faceted — same as above.
- Visit
/tag/:slug— sidebar still global; pill links still go to the global tag feed. - Visit
/—TagListcontinues to show all tags and link to global tag feeds.
Last updated 2026-06-02
Links to this note
Credits
Merged pull requests, newest first.