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>
22 lines
548 B
Go
22 lines
548 B
Go
package pubmodel
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
"iter"
|
|
|
|
"lmika.dev/lmika/weiro/models"
|
|
)
|
|
|
|
type Site struct {
|
|
models.Site
|
|
BaseURL string
|
|
Uploads []models.Upload
|
|
|
|
OpenUpload func(u models.Upload) (io.ReadCloser, error)
|
|
PostIter func(ctx context.Context) iter.Seq[models.Maybe[*models.Post]]
|
|
Categories []models.CategoryWithCount
|
|
PostIterByCategory func(ctx context.Context, categoryID int64) iter.Seq[models.Maybe[*models.Post]]
|
|
CategoriesOfPost func(ctx context.Context, postID int64) ([]*models.Category, error)
|
|
}
|