feat: 前台动态路由与积木页面、网页路径/发布/模式、PAGE_BUILDER 文档

Made-with: Cursor
This commit is contained in:
whm
2026-03-19 16:20:48 +08:00
parent b17e99eb93
commit ea163dbf8e
11 changed files with 732 additions and 29 deletions

View File

@@ -13,13 +13,16 @@ type Site struct {
// Page 网页(属于某站点)
type Page struct {
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
SiteID string `bson:"site_id" json:"site_id"`
Slug string `bson:"slug" json:"slug"` // index, about, ...
Title string `bson:"title" json:"title"`
Type string `bson:"type" json:"type"` // homepage, page
Content string `bson:"content" json:"content"` // HTML 或 JSON 字符串
UpdatedAt string `bson:"updated_at" json:"updated_at"`
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
SiteID string `bson:"site_id" json:"site_id"`
Slug string `bson:"slug" json:"slug"` // index, about, ...
Title string `bson:"title" json:"title"`
Type string `bson:"type" json:"type"` // homepage, page
Content string `bson:"content" json:"content"` // html 模式为 HTMLbuilder 模式为 JSON见文档
ContentMode string `bson:"content_mode,omitempty" json:"content_mode"` // html | builder空视为 html
RoutePath string `bson:"route_path,omitempty" json:"route_path"` // 自定义前台路径,如 /about空则用 /{slug}
Published *bool `bson:"published,omitempty" json:"published"` // nil 或未设视为已发布
UpdatedAt string `bson:"updated_at" json:"updated_at"`
}
// HomepageData 首页可编辑数据(与 yuheng-download-space 对应)