Files
SEONexus/docs/old-tmp-seo/23-老模板逐文件改动蓝图-2026-04-17.md
2026-04-17 21:09:06 +08:00

338 lines
8.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 1292-SEONexus 老模板逐文件改动蓝图 - 2026-04-17
## 目的
这份文档不是再讲“为什么要改”,而是给主 Codex 一个几乎可以直接照着写 patch 的蓝图。
使用方式:
1. 先看 [21-老模板实施安全边界与GPT隔离说明-2026-04-17.md](/www/wwwroot/VideoSource2/docs/old-tmp-seo/21-老模板实施安全边界与GPT隔离说明-2026-04-17.md)
2. 再看 [22-老模板第一批实施任务单与验收矩阵-2026-04-17.md](/www/wwwroot/VideoSource2/docs/old-tmp-seo/22-老模板第一批实施任务单与验收矩阵-2026-04-17.md)
3. 最后按本文件逐文件落 patch
## 一、分类页 `getCategoryType.html` 改动蓝图
### 适用文件
- `videoDadi/video/getCategoryType.html`
- `videoDingZhu/video/getCategoryType.html`
- `videoBoKu/video/getCategoryType.html`
- `videoLaoNiu/video/getCategoryType.html`
- `videoNuNu/video/getCategoryType.html`
### 当前问题
共同问题:
- `og:url` 指首页
- `CollectionPage.url` 指首页
- 缺 canonical
### 目标状态
分类页 head 里至少统一成:
1. `canonical = 当前分类页真实 URL`
2. `og:url = 当前分类页真实 URL`
3. `CollectionPage.url = 当前分类页真实 URL`
### 最稳参考
直接参考 `videoGpt1` 当前写法:
- [videoGpt1/getCategoryType.html:15](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getCategoryType.html:15)
- [videoGpt1/getCategoryType.html:19](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getCategoryType.html:19)
- [videoGpt1/getCategoryType.html:46](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getCategoryType.html:46)
### 建议实现结构
`head` block 最前面补一条分类页 canonical
```tpl
<link rel="canonical" href='https://{$DomainModel->d_domain}{site:vciurl parent_category="$Request.route.strParentCategory" /}'>
```
然后把现有:
```tpl
<meta property="og:url" content="https://{$DomainModel->d_domain}" />
```
统一改成:
```tpl
<meta property="og:url" content='https://{$DomainModel->d_domain}{site:vciurl parent_category="$Request.route.strParentCategory" /}' />
```
再把 JSON-LD 里的:
```tpl
"url": "https://{$DomainModel->d_domain}",
```
改成:
```tpl
"url": "https://{$DomainModel->d_domain}{site:vciurl parent_category="$Request.route.strParentCategory" /}",
```
### 可顺手补的项
如果改动很顺,也建议补:
```tpl
<meta name="robots" content="index,follow">
```
这不是当前最核心收益点,但与分类页聚合定位是一致的。
### 改后页面级验收
打开任一分类页,确认:
1. 页面源代码出现 canonical
2. canonical 指向分类页自己
3. `og:url` 指向分类页自己
4. JSON-LD `CollectionPage.url` 指向分类页自己
## 二、播放页 `getVideoPlayUrl.html` 改动蓝图
### 适用文件
- `videoDadi/video/getVideoPlayUrl.html`
- `videoDingZhu/video/getVideoPlayUrl.html`
- `videoBoKu/video/getVideoPlayUrl.html`
- `videoLaoNiu/video/getVideoPlayUrl.html`
- `videoNuNu/video/getVideoPlayUrl.html`
### 当前问题
共同问题:
- canonical 指播放页
- `og:url` 指详情页
- JSON-LD `url` 指详情页
### 目标状态
播放页三件套统一:
1. canonical 指播放页自己
2. `og:url` 指播放页自己
3. JSON-LD `url` 指播放页自己
### 最稳参考
参考 `videoGpt1` 播放页:
- [videoGpt1/getVideoPlayUrl.html:117](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html:117)
- [videoGpt1/getVideoPlayUrl.html:143](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html:143)
- [videoGpt1/getVideoPlayUrl.html:202](/www/wwwroot/VideoSource2/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html:202)
### 建议实现结构
老模板现在已经有 canonical例如
- [videoDadi/getVideoPlayUrl.html:58](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/video/getVideoPlayUrl.html:58)
第一批最稳做法不是大改数据流,而是先把现有 `site:vpurl ...` 结果复用起来。
如果模板表达式可读性允许,直接统一为:
```tpl
{assign name="strPlayCanonicalUrl" value='https://`$DomainModel->d_domain`{site:vpurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en" play_type="default" play_index="1" /}' /}
```
如果 `assign` 混模板标签不稳,就直接把原地三处替换成同一条 `site:vpurl ...` 写法。
将当前:
```tpl
<meta property="og:url" content='https://{$DomainModel->d_domain}{site:vurl ...}'>
```
改成:
```tpl
<meta property="og:url" content='https://{$DomainModel->d_domain}{site:vpurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en" play_type="default" play_index="1" /}'>
```
将 JSON-LD 里的:
```tpl
"url": 'https://{$DomainModel->d_domain}{site:vurl ...}',
```
改成:
```tpl
"url": 'https://{$DomainModel->d_domain}{site:vpurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en" play_type="default" play_index="1" /}',
```
### 当前第一批的保守策略
这里有一个需要主 Codex 注意的地方:
当前老模板 canonical 写死的是:
- `play_type="default"`
- `play_index="1"`
这并不一定等于当前访问中的真实线路和集数。
所以第一批有两种路线:
#### 路线 A保守收口
目标:
- 先让三件套一致
- 即使先全部收口到默认播放页,也比 detail/play 信号分裂更好
优点:
- 改动小
- 风险低
- 更快看到 `play|301` 收敛
#### 路线 B精确收口
目标:
- canonical / `og:url` / JSON-LD 精确指向当前播放中的真实 `play_type + play_index`
优点:
- 信号最准确
风险:
- 老模板当前 `Request.route` 和数据链未必完全统一
- 更容易把第一批改动做复杂
当前建议:
- 第一批先走路线 A
- 第二批再考虑是否升级到路线 B
### 改后页面级验收
打开任一播放页,确认:
1. canonical 存在
2. `og:url` 与 canonical 一致
3. JSON-LD `url` 与 canonical 一致
## 三、`sitemap-main.xml` 改动蓝图
### 适用文件
- `videoDadi/sitemap/sitemap-main.xml`
- `videoDingZhu/sitemap/sitemap-main.xml`
- `videoBoKu/sitemap/sitemap-main.xml`
- `videoLaoNiu/sitemap/sitemap-main.xml`
- `videoNuNu/sitemap/sitemap-main.xml`
### 当前问题
共同问题:
1. 输出 host 带 `www`
2. 目录明明是视频站,却用了:
- `novel:category`
- `site:nflurl`
### 第一批目标
第一批不追求“一步做出终极 sitemap”先做两件事
1. 不继续输出明显错误的小说站 URL
2. host 口径与当前主模板输出一致
### 建议改法
#### 最保守版本
如果主 Codex 当前对视频站 sitemap 真实结构还没完全确认,第一批可以先把 `sitemap-main.xml` 收缩成最小正确集:
- 首页
- 榜单页
也就是保留:
- [sitemap-main.xml:3-15](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/sitemap/sitemap-main.xml:3)
但把:
- [sitemap-main.xml:17-31](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/sitemap/sitemap-main.xml:17)
这一整段小说站逻辑先移除或注释为待重建。
同时把:
```xml
https://www.{$DomainModel->d_domain}
```
统一改成:
```xml
https://{$DomainModel->d_domain}
```
#### 更积极版本
如果主 Codex 很快确认了视频分类页应走 `site:vciurl` 或其他视频路由,那就直接按视频分类 URL 重建分类 sitemap。
当前我建议第一批先别赌这一步,先走最保守版本更稳。
### 改后页面级验收
访问 `sitemap-main.xml`,确认:
1. 返回正常 XML
2. 没有 `novel`/`nflurl` 这类错误视频站路径
3. host 输出与页面主输出一致
## 四、逐文件施工顺序
建议主 Codex 严格按下面顺序:
1. 五套 `getCategoryType.html`
2. 五套 `getVideoPlayUrl.html`
3. 五套 `sitemap-main.xml`
不要交叉着零散改。
原因:
- 先收聚合页
- 再收播放页
- 最后再收 sitemap
这样每一步的日志变化更容易归因。
## 五、改动后的优先复测域名
### 分类页优先复测
- `ningxiaowei.com`
- `www.ningxiaowei.com`
- `sctyjz.com`
- `www.ap-hulan.com`
### 播放页优先复测
- `yagyjt.com`
- `ningxiaowei.com`
### sitemap 优先复测
- `sctyjz.com`
- `hymdrz.com`
- `www.ap-hulan.com`
## 六、一句话交接
> 主 Codex 如果现在开始动老模板第一批 patch最稳方法就是分类页直接参考 `videoGpt1` 的分类页写法做 URL 收口;播放页先保守统一到同一条 `site:vpurl`sitemap-main 第一批先去掉明显错误的小说逻辑并收口 host。先把信号统一再追求更精细化。