老模板优化

This commit is contained in:
Your Name
2026-04-17 21:09:06 +08:00
parent 4dc78e3366
commit c8fb6956ef
60 changed files with 9113 additions and 146 deletions

View File

@@ -0,0 +1,152 @@
# 1290-SEONexus 老模板实施安全边界与 GPT 隔离说明 - 2026-04-17
## 目的
这份文档用于明确两件事:
1. 老模板第一批 SEO 修正,具体应该改哪些文件
2. 为什么这些改动可以与 `videoGpt1` 隔离,不会直接误伤 GPT 模板
## 一、当前边界结论
老模板第一批建议改动范围,只限下面 5 套目录:
- `code/app/home/view/videoDadi`
- `code/app/home/view/videoDingZhu`
- `code/app/home/view/videoBoKu`
- `code/app/home/view/videoLaoNiu`
- `code/app/home/view/videoNuNu`
`videoGpt1` 是单独目录:
- `code/app/home/view/videoGpt1`
因此只要后续改动严格限制在老模板 5 套目录内,物理上就不会直接修改到 `videoGpt1` 模板文件。
## 二、第一批建议改动文件清单
每套老模板当前建议只动 4 个文件:
1. `video/getCategoryType.html`
2. `video/getVideoPlayUrl.html`
3. `sitemap/sitemap-main.xml`
4. `sitemap/robots.txt`
总计:
- 5 套模板 x 4 个文件 = 20 个文件
这就是当前最稳的第一批实施边界。
## 三、为什么这批改动不会直接碰到 GPT 模板
### 1. 文件不共享
老模板和 GPT 模板虽然文件名类似,但文件路径不同。
例如:
- 老模板:
- [videoDadi/video/getCategoryType.html](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/video/getCategoryType.html:1)
- [videoDingZhu/video/getCategoryType.html](/www/wwwroot/VideoSource2/code/app/home/view/videoDingZhu/video/getCategoryType.html:1)
- GPT 模板:
- [videoGpt1/video/getCategoryType.html](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getCategoryType.html:1)
这不是同一个文件的不同分支,而是完全独立的模板文件。
### 2. GPT 模板当前本身已经有更正确的写法
例如 `videoGpt1` 分类页:
- [videoGpt1/video/getCategoryType.html](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getCategoryType.html:14)
当前已经是:
- canonical 指向分类页真实 URL
- `og:url` 指向分类页真实 URL
- `CollectionPage.url` 指向分类页真实 URL
这恰好说明:
- 老模板要修的是自己的旧写法
- 不是去改 GPT 模板的现有逻辑
### 3. GPT 模板播放页也有独立实现
例如:
- [videoGpt1/video/getVideoPlayUrl.html](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html:1)
GPT 模板播放页已经接了自己的:
- `seoCopy`
- breadcrumb 构造
- `VideoService` 调用链
因此老模板这次第一批修正,没有必要也不应该去碰 GPT 模板播放页。
## 四、目前真正需要注意的风险,不在模板文件本身
虽然模板文件可隔离,但仍有两类风险需要提醒主 Codex
### 1. 如果去改共享底层服务,就可能波及 GPT
例如这类底层:
- `SiteContext`
- `VideoService`
- 通用 taglib / helper
- 路由层
如果后续修正不是停留在模板输出,而是去改这些共享服务,那就有可能影响 `videoGpt1`
所以当前建议是:
- 第一批先只改模板层
- 不先动共享服务层
### 2. sitemap 问题看起来可能是全模板共性
这次复核时还确认了:
- `videoGpt1/sitemap/sitemap-main.xml` 也有与老模板类似的 `www + novel` 可疑写法
例如:
- [videoGpt1/sitemap/sitemap-main.xml](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/sitemap/sitemap-main.xml:4)
但这不代表这次应该顺手一起改 GPT。
更稳的做法是:
- 先把老模板线独立处理
- GPT 那边单独开任务、单独验证
## 五、第一批实施时的安全规则
主 Codex 如果开始动代码,建议固定遵守下面 5 条:
1. 只改 `videoDadi / videoDingZhu / videoBoKu / videoLaoNiu / videoNuNu`
2. 第一批只改 `getCategoryType / getVideoPlayUrl / sitemap-main / robots.txt`
3. 不碰 `videoGpt1` 目录
4. 不先碰 `VideoService / SiteContext / router` 这类共享底层
5. 每改完一类文件,就先做老模板样本验证,再决定是否继续
## 六、最稳的实施顺序
从安全性和 SEO 收益一起看,最稳顺序是:
1. 先改 5 套 `getCategoryType.html`
2. 再改 5 套 `getVideoPlayUrl.html`
3. 再改 5 套 `sitemap/sitemap-main.xml`
4. 最后复核 5 套 `robots.txt`
这样做的好处是:
- 改动集中
- 影响面可控
- 每一步都容易归因
## 一句话结论
> 当前老模板第一批 SEO 修正可以和 `videoGpt1` 明确隔离,最安全的落地边界就是只动老模板 5 套目录下那 20 个模板文件;只要不下沉去改共享服务层,就不会直接影响 GPT 模板。