Add categories feature #3

Merged
lmika merged 14 commits from feature/categories into main 2026-03-21 23:29:05 +00:00
Owner

Summary

  • Add many-to-many categories system: database migration, model, sqlc queries, DB provider, service layer with CRUD + slug generation + collision detection
  • Admin UI: category management pages (create/edit/delete), category checkboxes in post edit sidebar, category badges on post list
  • Site builder: category index page, per-category archive pages, per-category RSS/JSON feeds, category metadata in main feeds
  • Empty categories hidden from published site but visible in admin

Test Plan

  • Create, edit, and delete categories via admin UI
  • Assign categories to posts and verify they persist
  • Publish site and verify category index, archive pages, and per-category feeds
  • Verify empty categories don't appear on published site
  • Verify category badges appear on admin post list
  • Run go test ./models/... ./providers/db/... ./providers/sitebuilder/...
Summary - Add many-to-many categories system: database migration, model, sqlc queries, DB provider, service layer with CRUD + slug generation + collision detection - Admin UI: category management pages (create/edit/delete), category checkboxes in post edit sidebar, category badges on post list - Site builder: category index page, per-category archive pages, per-category RSS/JSON feeds, category metadata in main feeds - Empty categories hidden from published site but visible in admin Test Plan - Create, edit, and delete categories via admin UI - Assign categories to posts and verify they persist - Publish site and verify category index, archive pages, and per-category feeds - Verify empty categories don't appear on published site - Verify category badges appear on admin post list - Run go test ./models/... ./providers/db/... ./providers/sitebuilder/...
lmika added 11 commits 2026-03-18 11:13:30 +00:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds updated_at field, transaction requirement, slug collision
handling, authorization checks, explicit query filters, pubmodel
signatures, and template registration notes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9-task plan covering migration, sqlc queries, DB provider,
service layer, admin UI, post form integration, site builder
with category pages and per-category feeds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements SaveCategory, SelectCategory, SelectCategoriesOfSite,
SelectCategoryBySlugAndSite, DeleteCategory, SelectCategoriesOfPost,
SelectPostsOfCategory, CountPostsOfCategory, and SetPostCategories on
the DB Provider, along with BeginTx/QueriesWithTx for transaction
support. Also fixes pre-existing compilation errors in provider_test.go
(missing PagingParams args) so new tests can compile and run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire up categories service, add CategoriesHandler with full CRUD, create index/edit templates, register routes in server.go, and add Categories nav link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extend the publishing pipeline to generate category index pages,
per-category archive pages, per-category RSS/JSON feeds, and display
categories on individual post pages and post lists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Slug collision checks now properly propagate real DB errors instead of
  silently ignoring them
- GetCategory now verifies site ownership, matching the pattern used by
  UpdateCategory and DeleteCategory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lmika added 1 commit 2026-03-18 11:19:38 +00:00
lmika added 2 commits 2026-03-21 23:28:44 +00:00
lmika merged commit fa676cfdf7 into main 2026-03-21 23:29:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lmika/weiro#3
No description provided.