feat: 注入块拖拽排序(后台顺序即渲染顺序)+ theme.json 声明 inject_points + 主题卡片展示注入点
This commit is contained in:
+6
-1
@@ -22,7 +22,8 @@ themes/{name}/
|
||||
"version": "1.0.0",
|
||||
"description": "主题描述",
|
||||
"author": "作者",
|
||||
"screenshot": "screenshot.png"
|
||||
"screenshot": "screenshot.png",
|
||||
"inject_points": ["head", "header", "sidebar_top", "sidebar_bottom", "content_top", "content_bottom", "post_content_top", "post_content_bottom", "footer", "body_end"]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -124,6 +125,10 @@ themes/{name}/
|
||||
|
||||
新主题须在对应 partial/视图放置 `@stack('theme:xxx')` 才能接收注入。
|
||||
|
||||
**声明注入点**:`theme.json` 的 `inject_points` 声明主题实现了哪些注入点(缺省视为全部支持),后台主题卡片会展示,切换主题时一目了然。
|
||||
|
||||
**多注入排序**:同一位置可添加多条,后台「主题注入」页按列表拖拽排序,保存后按顺序渲染。
|
||||
|
||||
## 预览图
|
||||
|
||||
`theme.json` 的 `screenshot` 指向 `assets/` 下的预览图(如 `screenshot.png`),后台主题管理以卡片形式展示。可用无头浏览器截图生成:`node` + playwright 打开站点首页保存为 `themes/{name}/assets/screenshot.png`。
|
||||
|
||||
Reference in New Issue
Block a user