feat: restore sablog browse modes and clean imported HTML
Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+21
-11
@@ -35,17 +35,17 @@ routes/web.php # 前台规范路由;routes/legacy.php 老 URL 301(新增
|
||||
|
||||
### 钩子清单
|
||||
|
||||
| Hook | 类型 | 参数 | 用途 |
|
||||
|------|------|------|------|
|
||||
| `post.rendered` | filter | `(string $html, Post): string` | 文章渲染后处理 |
|
||||
| `comment.created` | action | `Comment` | 新评论创建 |
|
||||
| `payment.paid` | action | `Payment` | 支付成功分发 |
|
||||
| `filament.post_form` | action | `Schema` | 文章表单注入 |
|
||||
| `filament.post_table` | action | `Table` | 文章表格注入 |
|
||||
| `seo.structured_data` | filter | `(array): array` | JSON-LD 扩展 |
|
||||
| `theme.inject.{point}` | filter | `(string): string` | 注入点追加 HTML |
|
||||
| Hook | 类型 | 参数 | 用途 |
|
||||
| ---------------------- | ------ | ------------------------------ | --------------- |
|
||||
| `post.rendered` | filter | `(string $html, Post): string` | 文章渲染后处理 |
|
||||
| `comment.created` | action | `Comment` | 新评论创建 |
|
||||
| `payment.paid` | action | `Payment` | 支付成功分发 |
|
||||
| `filament.post_form` | action | `Schema` | 文章表单注入 |
|
||||
| `filament.post_table` | action | `Table` | 文章表格注入 |
|
||||
| `seo.structured_data` | filter | `(array): array` | JSON-LD 扩展 |
|
||||
| `theme.inject.{point}` | filter | `(string): string` | 注入点追加 HTML |
|
||||
|
||||
> `Schema::components()` / `Table::columns()` 是**替换**语义:表单用 `[...$schema->getComponents(), Section::make(...)]` 合并,表格用 `pushColumns()`。
|
||||
> 文章表单是左 2 右 1:插件用 `PostForm::appendToSidebar()` / `PostForm::appendToAccessSection()` 注入,不要往根节点追加整行 Section。表格仍用 `pushColumns()`。
|
||||
|
||||
## 4. 主题规范(详见 docs/themes.md)
|
||||
|
||||
@@ -74,7 +74,17 @@ routes/web.php # 前台规范路由;routes/legacy.php 老 URL 301(新增
|
||||
- 不提交:`.env`、密钥/证书、`storage/media-library/temp/`、构建产物
|
||||
- 完成后更新对应 `docs/` 文档
|
||||
|
||||
## 8. 常用命令速查
|
||||
## 8. 后台导航约定
|
||||
|
||||
- 顶栏 **网站** 打开前台新窗口,**写文章** 进新建文章
|
||||
- **管理 → 页面缓存**:查看/清理前台整页缓存,不要只藏在用户菜单里
|
||||
- **管理 → 语言**:只展示当前 `APP_LOCALE` 和已有语言包。文章还没有多语言版本,不要假装已经做了
|
||||
- 文章置顶用 `sticky_level`(0/1/2/3),列表排序 `orderedForList()`。3 = 置顶头条,永远最前
|
||||
- 前台 RSS / Sitemap / llms.txt 开新窗口。`/llms.txt` 和 `/posts/{slug}.md` 是核心路由,不要做成静态文件,新文章要马上出现
|
||||
- 首页浏览模式:`home_view_mode` + `?view=list|full` + cookie `ll_home_view`。分页用 `blog_paginate()`(`onEachSide(1)`)
|
||||
- 老 sablog 正文清洗放 `SablogHtmlNormalizer`,导入 / 渲染 / `sablog:fix-content` 共用,不要各写一套 strip_tags
|
||||
|
||||
## 9. 常用命令速查
|
||||
|
||||
```bash
|
||||
php artisan test # 全量测试
|
||||
|
||||
Reference in New Issue
Block a user