Add categories feature #3

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

14 commits

Author SHA1 Message Date
Leon Mika d9aec4af2c Styled the categories on the site 2026-03-22 10:28:33 +11:00
Leon Mika f45bdcd83c Styled the admin section of categories. 2026-03-21 12:01:24 +11:00
Leon Mika 740cf8979a fix: unit tests 2026-03-18 22:19:26 +11:00
Leon Mika 9efa40879f fix: improve error handling in categories service
- 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>
2026-03-18 22:11:33 +11:00
Leon Mika 6c69131b03 feat: add category pages and per-category feeds to site builder
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>
2026-03-18 21:51:19 +11:00
Leon Mika 4c2ce7272d feat: add category selection to post edit form and badges to post list
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 21:45:28 +11:00
Leon Mika ffa86b12e9 feat: add categories admin UI with CRUD
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>
2026-03-18 21:42:17 +11:00
Leon Mika 3c80f63a55 feat: add categories service with CRUD and slug validation 2026-03-18 21:38:41 +11:00
Leon Mika 15bc6b7f73 feat: add DB provider methods for categories
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>
2026-03-18 21:37:01 +11:00
Leon Mika d47095a902 feat: add sqlc queries for categories 2026-03-18 21:33:55 +11:00
Leon Mika 641b402d4a feat: add categories migration and model
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 21:32:24 +11:00
Leon Mika 41c8d1e2f5 Add categories implementation plan
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>
2026-03-18 21:29:11 +11:00
Leon Mika 9a02a2f8af Address spec review feedback for categories design
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>
2026-03-18 21:14:24 +11:00
Leon Mika 847e8e76d0 Add categories feature design spec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 21:11:18 +11:00