From 10d6acd62702cb36a8ff83cd5557ca430a468e44 Mon Sep 17 00:00:00 2001 From: make Date: Tue, 2 Dec 2025 13:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/app/common/helper/SiteStyle.php | 100 ++++++ code/app/common/helper/TextSpin.php | 24 ++ code/app/home/view/videoGpt1/base.html | 100 ++++++ code/app/home/view/videoGpt1/index.md | 58 ++++ code/app/home/view/videoGpt1/index/index.html | 46 +++ .../home/view/videoGpt1/public/footer.html | 56 ++++ .../view/videoGpt1/public/module-banner.html | 10 + .../videoGpt1/public/module-category.html | 0 .../view/videoGpt1/public/module-newest.html | 17 + .../view/videoGpt1/public/module-ranking.html | 0 .../videoGpt1/public/module-recommend.html | 17 + .../videoGpt1/public/module-trending.html | 17 + .../view/videoGpt1/public/video-list-phb.html | 18 ++ .../videoGpt1/public/video-list-shu-pf.html | 23 ++ .../view/videoGpt1/public/video-list-shu.html | 26 ++ .../videoGpt1/public/video-list-text.html | 12 + .../videoGpt1/public/video-panel-back.html | 1 + .../view/videoGpt1/public/video-panel.html | 55 ++++ code/app/home/view/videoGpt1/rss/baidu.xml | 40 +++ code/app/home/view/videoGpt1/rss/so.xml | 18 ++ code/app/home/view/videoGpt1/sitemap/index.md | 294 ++++++++++++++++++ .../home/view/videoGpt1/sitemap/robots.txt | 38 +++ .../sitemap/sitemap-books-catalog.xml | 20 ++ .../view/videoGpt1/sitemap/sitemap-books.xml | 20 ++ .../videoGpt1/sitemap/sitemap-chapters.xml | 18 ++ .../view/videoGpt1/sitemap/sitemap-main.xml | 35 +++ .../view/videoGpt1/sitemap/sitemap_index.xml | 39 +++ .../home/view/videoGpt1/user/getHistory.html | 104 +++++++ .../view/videoGpt1/video/getCategory.html | 135 ++++++++ .../view/videoGpt1/video/getCategoryType.html | 257 +++++++++++++++ .../app/home/view/videoGpt1/video/getMap.html | 146 +++++++++ .../view/videoGpt1/video/getRankIndex.html | 169 ++++++++++ .../view/videoGpt1/video/getRankList.html | 203 ++++++++++++ .../view/videoGpt1/video/getSearchVideo.html | 122 ++++++++ .../view/videoGpt1/video/getVideoInfo.html | 219 +++++++++++++ .../view/videoGpt1/video/getVideoPlayUrl.html | 191 ++++++++++++ .../推广优化记录/首页/上先前ai排查.md | 292 +++++++++++++++++ code/app/services/SiteContext.php | 5 +- code/public/initdata/video/siteData.php | 53 +++- code/public/initdata/video/viewTemplate.php | 7 + .../template/videoGpt1/static/css/style_1.css | 160 ++++++++++ 41 files changed, 3163 insertions(+), 2 deletions(-) create mode 100644 code/app/common/helper/SiteStyle.php create mode 100644 code/app/common/helper/TextSpin.php create mode 100644 code/app/home/view/videoGpt1/base.html create mode 100644 code/app/home/view/videoGpt1/index.md create mode 100644 code/app/home/view/videoGpt1/index/index.html create mode 100644 code/app/home/view/videoGpt1/public/footer.html create mode 100644 code/app/home/view/videoGpt1/public/module-banner.html create mode 100644 code/app/home/view/videoGpt1/public/module-category.html create mode 100644 code/app/home/view/videoGpt1/public/module-newest.html create mode 100644 code/app/home/view/videoGpt1/public/module-ranking.html create mode 100644 code/app/home/view/videoGpt1/public/module-recommend.html create mode 100644 code/app/home/view/videoGpt1/public/module-trending.html create mode 100644 code/app/home/view/videoGpt1/public/video-list-phb.html create mode 100644 code/app/home/view/videoGpt1/public/video-list-shu-pf.html create mode 100644 code/app/home/view/videoGpt1/public/video-list-shu.html create mode 100644 code/app/home/view/videoGpt1/public/video-list-text.html create mode 100644 code/app/home/view/videoGpt1/public/video-panel-back.html create mode 100644 code/app/home/view/videoGpt1/public/video-panel.html create mode 100644 code/app/home/view/videoGpt1/rss/baidu.xml create mode 100644 code/app/home/view/videoGpt1/rss/so.xml create mode 100644 code/app/home/view/videoGpt1/sitemap/index.md create mode 100644 code/app/home/view/videoGpt1/sitemap/robots.txt create mode 100644 code/app/home/view/videoGpt1/sitemap/sitemap-books-catalog.xml create mode 100644 code/app/home/view/videoGpt1/sitemap/sitemap-books.xml create mode 100644 code/app/home/view/videoGpt1/sitemap/sitemap-chapters.xml create mode 100644 code/app/home/view/videoGpt1/sitemap/sitemap-main.xml create mode 100644 code/app/home/view/videoGpt1/sitemap/sitemap_index.xml create mode 100644 code/app/home/view/videoGpt1/user/getHistory.html create mode 100644 code/app/home/view/videoGpt1/video/getCategory.html create mode 100644 code/app/home/view/videoGpt1/video/getCategoryType.html create mode 100644 code/app/home/view/videoGpt1/video/getMap.html create mode 100644 code/app/home/view/videoGpt1/video/getRankIndex.html create mode 100644 code/app/home/view/videoGpt1/video/getRankList.html create mode 100644 code/app/home/view/videoGpt1/video/getSearchVideo.html create mode 100644 code/app/home/view/videoGpt1/video/getVideoInfo.html create mode 100644 code/app/home/view/videoGpt1/video/getVideoPlayUrl.html create mode 100644 code/app/home/view/videoGpt1/推广优化记录/首页/上先前ai排查.md create mode 100644 code/public/template/videoGpt1/static/css/style_1.css diff --git a/code/app/common/helper/SiteStyle.php b/code/app/common/helper/SiteStyle.php new file mode 100644 index 0000000..ebb77bf --- /dev/null +++ b/code/app/common/helper/SiteStyle.php @@ -0,0 +1,100 @@ + 0; $i--) { + $rand = ($rand * 31 + 17) & 0x7fffffff; // 线性同余生成器 + $j = $rand % ($i + 1); + // 交换 + $temp = $moduleOrder[$i]; + $moduleOrder[$i] = $moduleOrder[$j]; + $moduleOrder[$j] = $temp; + } + + return [ + 'theme_id' => $themeId, + 'color_primary' => self::randColor($seed . '_pri'), + 'color_secondary' => self::randColor($seed . '_sec'), + 'color_accent' => self::randColor($seed . '_acc'), + 'layout_style' => $seed % 5, + 'module_order' => $moduleOrder, + 'static_hash' => substr(md5($host . 'v2025'), 0, 10), + 'is_dark_mode' => ($seed % 8 === 0), + 'show_ads' => ($seed % 3 !== 0), + ]; + } + + /** + * 生成好看的随机色(完全不依赖 mt_srand) + */ + private static function randColor($seedStr) + { + $hash = crc32($seedStr); + + // 色相 0~359 + $h = $hash % 360; + + // 饱和度 45~92%(避免太灰) + $s = 45 + (($hash >> 8) % 48); + + // 亮度 38~78%(避免太暗或太刺眼) + $l = 38 + (($hash >> 16) % 41); + + return self::hslToHex($h, $s, $l); + } + + /** + * HSL → HEX 转换(精准无误) + */ + private static function hslToHex($h, $s, $l) + { + $h /= 360; + $s /= 100; + $l /= 100; + + $c = (1 - abs(2 * $l - 1)) * $s; + $x = $c * (1 - abs(fmod($h * 6, 2) - 1)); + $m = $l - $c / 2; + + if ($h < 1 / 6) { + [$r, $g, $b] = [$c, $x, 0]; + } elseif ($h < 2 / 6) { + [$r, $g, $b] = [$x, $c, 0]; + } elseif ($h < 3 / 6) { + [$r, $g, $b] = [0, $c, $x]; + } elseif ($h < 4 / 6) { + [$r, $g, $b] = [0, $x, $c]; + } elseif ($h < 5 / 6) { + [$r, $g, $b] = [$x, 0, $c]; + } else { + [$r, $g, $b] = [$c, 0, $x]; + } + + return sprintf( + "#%02X%02X%02X", + round(($r + $m) * 255), + round(($g + $m) * 255), + round(($b + $m) * 255) + ); + } +} diff --git a/code/app/common/helper/TextSpin.php b/code/app/common/helper/TextSpin.php new file mode 100644 index 0000000..f71bf03 --- /dev/null +++ b/code/app/common/helper/TextSpin.php @@ -0,0 +1,24 @@ + ['出色', '亮眼', '优秀'], + '故事' => ['剧情', '情节'], + '演员' => ['主演', '表演者'], + '描述' => ['讲述', '叙述'], + ]; + + mt_srand($seed); + foreach ($synonyms as $k => $v) { + $text = str_replace($k, $v[array_rand($v)], $text); + } + + return $text; + } +} diff --git a/code/app/home/view/videoGpt1/base.html b/code/app/home/view/videoGpt1/base.html new file mode 100644 index 0000000..795e083 --- /dev/null +++ b/code/app/home/view/videoGpt1/base.html @@ -0,0 +1,100 @@ + + + + {block name="get-data"}{/block} + + + {block name="title"}{/block} + + + + + + + + + + + + + + {block name="head"}{/block} + {block name="head-css"}{/block} + {block name="head-js"}{/block} + + + + + + + + +
+ {block name="main"} + {/block} +
+ + + + +
tpl-{$TpStyle.static_hash}
+ + +{// 全局统计 } + {site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/} + +{// 站点统计 } +{$DomainModel->d_statis|raw} + + + + diff --git a/code/app/home/view/videoGpt1/index.md b/code/app/home/view/videoGpt1/index.md new file mode 100644 index 0000000..cdcfd38 --- /dev/null +++ b/code/app/home/view/videoGpt1/index.md @@ -0,0 +1,58 @@ +努力视频模板 +http://test.maihoe.com/ + +1.视频分类 分页标签查询, 增加 4个查询字段 + +$v_class = $tag['v_class'] ?? '10'; // 自定义分类 电影 电视剧 .. +$v_lang = $tag['v_lang'] ?? "all"; // 语言 +$v_area = $tag['v_area'] ?? "all"; // 地区 +$v_year = $tag['v_year'] ?? "all"; // 年份 + +2. 排行榜标签 增加 分类查询 +{video:ranklist v_class="dianying" v_category="$val.v_category_en" + + + +需要 配置tkd 模板的页面 + +首页: + h1: 站点名字 - 站点text logo + 丰富内容-》站点描述: + T + K + D + + +分类首页 +h1: 站点名字 - 站点text logo + 丰富内容-》站点描述: + tkd +分类分页 + +视频详情页面 +视频播放页面 + +视频搜索页面 +视频排行榜首页 +视频排行榜分页 + + +目前在搭建一个视频站点: +页面 有 +首页 +分类首页:分类首页没有分页,一共有 电影,电视剧,综艺,动漫,短剧 。5大分类。 + 分类首页 展示内容:每一大分类下面的所有小分类 展示10个视频; + 这个就是上面发你的代码; + 需要你帮忙设计 TKD 模板 + 和 h1标签内容 模板 + 因为我后面需要部署大量域名站点 都使用同一个模板 + +分类列表分页: + + + + + + + + diff --git a/code/app/home/view/videoGpt1/index/index.html b/code/app/home/view/videoGpt1/index/index.html new file mode 100644 index 0000000..ecda951 --- /dev/null +++ b/code/app/home/view/videoGpt1/index/index.html @@ -0,0 +1,46 @@ +{extend name="base" /} + +{block name="get-data"} + +{video:listexp count="6" sort_type="tuijian" d_key="key" d_val="Video" cache_life="3600" export_name="arrVideoTuijian" +/} +{video:listexp count="6" sort_type="piaofang" d_key="key" d_val="Video" cache_life="3600" +export_name="arrVideoPiaofang" /} + +{site:grm page_code="h5_index" diff="0" num="100" g_key="arrGrm" /} + +{/block} + +{block name="title"}{site:replace code="VIDEO@INDEX@INDEX@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@INDEX@INDEX@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION"}{/block} + +{block name="main"} + + + {// 模块按站群规则随机} + {volist name="$TpStyle.module_order" id="item" key="k"} + + {if $item == 'banner'} + {include file="public/module-banner" /} + {/if} + + {if $item == 'recommend'} + {include file="public/module-recommend" /} + {/if} + + {if $item == 'newest'} + {include file="public/module-newest" /} + {/if} + + {if $item == 'ranking'} + {include file="public/module-ranking" /} + {/if} + + {/volist} + +{/block} + diff --git a/code/app/home/view/videoGpt1/public/footer.html b/code/app/home/view/videoGpt1/public/footer.html new file mode 100644 index 0000000..0fe1df2 --- /dev/null +++ b/code/app/home/view/videoGpt1/public/footer.html @@ -0,0 +1,56 @@ +
+ + + +
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/public/module-banner.html b/code/app/home/view/videoGpt1/public/module-banner.html new file mode 100644 index 0000000..624fd43 --- /dev/null +++ b/code/app/home/view/videoGpt1/public/module-banner.html @@ -0,0 +1,10 @@ + +{if condition="isset($banner)"} + +{/if} diff --git a/code/app/home/view/videoGpt1/public/module-category.html b/code/app/home/view/videoGpt1/public/module-category.html new file mode 100644 index 0000000..e69de29 diff --git a/code/app/home/view/videoGpt1/public/module-newest.html b/code/app/home/view/videoGpt1/public/module-newest.html new file mode 100644 index 0000000..298a82f --- /dev/null +++ b/code/app/home/view/videoGpt1/public/module-newest.html @@ -0,0 +1,17 @@ +
+

最新更新

+ +
+ {volist name="arrVideoPiaofang" id="Video"} + +
+ {$Video.v_name ?? ''} - {$Video.v_parent_category ?? ''}{$Video.v_category ?? ''} +
+
{$Video.v_name}
+
+ {/volist} +
+
\ No newline at end of file diff --git a/code/app/home/view/videoGpt1/public/module-ranking.html b/code/app/home/view/videoGpt1/public/module-ranking.html new file mode 100644 index 0000000..e69de29 diff --git a/code/app/home/view/videoGpt1/public/module-recommend.html b/code/app/home/view/videoGpt1/public/module-recommend.html new file mode 100644 index 0000000..265fa60 --- /dev/null +++ b/code/app/home/view/videoGpt1/public/module-recommend.html @@ -0,0 +1,17 @@ +
+

编辑推荐

+ +
+ {volist name="arrVideoPiaofang" id="Video"} + +
+ {$Video.v_name ?? ''} - {$Video.v_parent_category ?? ''}{$Video.v_category ?? ''} +
+
{$Video.v_name}
+
+ {/volist} +
+
diff --git a/code/app/home/view/videoGpt1/public/module-trending.html b/code/app/home/view/videoGpt1/public/module-trending.html new file mode 100644 index 0000000..d7496ef --- /dev/null +++ b/code/app/home/view/videoGpt1/public/module-trending.html @@ -0,0 +1,17 @@ +
+

热门热播

+ +
+ {volist name="arrVideoPiaofang" id="Video"} + +
+ {$Video.v_name ?? ''} - {$Video.v_parent_category ?? ''}{$Video.v_category ?? ''} +
+
{$Video.v_name}
+
+ {/volist} +
+
diff --git a/code/app/home/view/videoGpt1/public/video-list-phb.html b/code/app/home/view/videoGpt1/public/video-list-phb.html new file mode 100644 index 0000000..f827337 --- /dev/null +++ b/code/app/home/view/videoGpt1/public/video-list-phb.html @@ -0,0 +1,18 @@ + +
  • + + {if !empty($arrGrm[$key + [start]])} + {$arrGrm[$key+[start]]|raw} + {/if} + + + {$key} + + {$Video.v_name} + +
  • diff --git a/code/app/home/view/videoGpt1/public/video-list-shu-pf.html b/code/app/home/view/videoGpt1/public/video-list-shu-pf.html new file mode 100644 index 0000000..937403d --- /dev/null +++ b/code/app/home/view/videoGpt1/public/video-list-shu-pf.html @@ -0,0 +1,23 @@ + + +
  • + {if !empty($arrGrm[$key + [start]])} + {$arrGrm[$key+[start]]|raw} + {/if} + + {$Video.v_name ?? ''} - {$Video.v_parent_category ?? ''}{$Video.v_category ?? ''}免费高清电影在线观看 + + {$Video.v_box_office ?? 0}亿 + {$Video.v_name} + {$Video.v_remarks} + + + +
  • \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/public/video-list-shu.html b/code/app/home/view/videoGpt1/public/video-list-shu.html new file mode 100644 index 0000000..574619f --- /dev/null +++ b/code/app/home/view/videoGpt1/public/video-list-shu.html @@ -0,0 +1,26 @@ + +
  • +
    + {if !empty($arrGrm[$key + [start]])} + {$arrGrm[$key+[start]]|raw} + {/if} + + {$Video.v_name ?? ''} - {$Video.v_parent_category ?? ''}{$Video.v_category ?? ''}免费高清电影在线观看 + + {$Video.v_remarks} + + +
    +
  • diff --git a/code/app/home/view/videoGpt1/public/video-list-text.html b/code/app/home/view/videoGpt1/public/video-list-text.html new file mode 100644 index 0000000..5ec592d --- /dev/null +++ b/code/app/home/view/videoGpt1/public/video-list-text.html @@ -0,0 +1,12 @@ + +
  • + {if !empty($arrGrm[$key + [start]])} + {$arrGrm[$key+[start]]|raw} + {/if} + + + {$Video.v_name} + +
  • diff --git a/code/app/home/view/videoGpt1/public/video-panel-back.html b/code/app/home/view/videoGpt1/public/video-panel-back.html new file mode 100644 index 0000000..b48135f --- /dev/null +++ b/code/app/home/view/videoGpt1/public/video-panel-back.html @@ -0,0 +1 @@ +v_parent_category_en="$val.v_category_en" diff --git a/code/app/home/view/videoGpt1/public/video-panel.html b/code/app/home/view/videoGpt1/public/video-panel.html new file mode 100644 index 0000000..0ccfcf2 --- /dev/null +++ b/code/app/home/view/videoGpt1/public/video-panel.html @@ -0,0 +1,55 @@ +
    + {video:ranklistexp count="18" v_parent_category_en="$val.v_category_en" sort_type="weekly" d_key="key" d_val="Video" cache_life="3600" +export_name="arrVideoRankList" /} +
    +
    +
    + + 更多 + + +

    + + + {$val.v_category} + +

    + +
    +
    + +
    +
    + +
    +
    +
      + {video:list count="6" v_parent_category_en="$val.v_category_en" sort_type="news" d_key="key" + d_val="Video" cache_life="3600"} + {include file="public/video-list-shu" start="33" col-md="6" /} + {/video:list} +
    +
    +
    + +
    +
    diff --git a/code/app/home/view/videoGpt1/rss/baidu.xml b/code/app/home/view/videoGpt1/rss/baidu.xml new file mode 100644 index 0000000..10eaad4 --- /dev/null +++ b/code/app/home/view/videoGpt1/rss/baidu.xml @@ -0,0 +1,40 @@ + + + + {$DomainModel->d_name} + {$DomainModel->d_description} + www.{$DomainModel->d_domain} + zh-cn + {$DomainModel->d_name} + Rss Powered By www.{$DomainModel->d_domain} + + {video:list count="30" + v_category_en="all" + v_lang_en="all" + v_area_en="all" + v_year="all" + sort_type="news" + d_key="d_key" d_val="Video" cache_life="86400"} + + + <?php echo html_entity_decode($Video['v_name'], ENT_QUOTES | ENT_XML1, 'UTF-8'); ?> {$Video.v_remarks} + + https://{$DomainModel->d_domain}{site:vurl v_id="$Video.v_id" v_py="$Video.v_name_en"/} + + {volist name='$Video.v_actor' id='vo' key='index'} + {$vo} , + {/volist} + + {$Video.v_publish_date} + +]]> + + + {/video:list} + + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/rss/so.xml b/code/app/home/view/videoGpt1/rss/so.xml new file mode 100644 index 0000000..f2880ba --- /dev/null +++ b/code/app/home/view/videoGpt1/rss/so.xml @@ -0,0 +1,18 @@ + + +{video:list count="1000" +v_category_en="all" +v_lang_en="all" +v_area_en="all" +v_year="all" +sort_type="news" +d_key="d_key" d_val="Video" cache_life="86400"} + + +https://www.{$DomainModel->d_domain}{site:vurl v_id="$Video.v_id" v_py="$Video.v_name_en"/} +{$Video.v_publish_date} + + +{/video:list} + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/sitemap/index.md b/code/app/home/view/videoGpt1/sitemap/index.md new file mode 100644 index 0000000..2a3de52 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/index.md @@ -0,0 +1,294 @@ +对于一个小说站点(如你提到的包含首页、分类列表、排行榜、男生/女生频道、详情页面、章节页面、目录页面等),配置 Sitemap 时需要根据页面类型的重要性和 SEO 目标选择性地包含 URL,并合理组织以优化搜索引擎抓取和索引。以下是针对小说站点特点的 Sitemap 配置建议,包括哪些页面应该包含、如何处理大量 URL,以及相关的最佳实践。 + +--- + +### 一、小说站点页面类型分析 +根据你提供的信息,小说站点的页面类型可以分为以下几类,每类页面的 SEO 价值和是否需要包含在 Sitemap 中有所不同: + +| 页面类型 | 描述 | SEO 价值 | 是否包含在 Sitemap | +|------------------|----------------------------------------------------------------------|---------------------------------------|--------------------| +| **首页** | 网站主入口,通常包含推荐小说、导航等。 | 高(核心流量入口) | 是 | +| **分类列表** | 按题材、类型(如玄幻、言情)展示小说列表,可能有多页(如 `page=2`)。| 高(引导用户到具体小说) | 是(仅包含主页面) | +| **排行榜** | 热门小说排行,可能按日、周、月或类型(如男生/女生)排序。 | 中到高(吸引点击,动态更新) | 是(视情况精选) | +| **男生/女生频道**| 针对不同用户群的分类页面(如男生玄幻、女生穿越)。 | 高(细分用户需求) | 是 | +| **详情页面** | 小说详情页,包含简介、封面、目录链接等。 | 高(核心转化页面) | 是 | +| **章节页面** | 小说具体章节内容,通常数量庞大。 | 中到低(内容分散,SEO 价值有限) | 视情况(可选) | +| **目录页面** | 小说章节列表,汇总所有章节链接。 | 中(便于用户导航,SEO 价值中等) | 是 | + +--- + +### 二、Sitemap 配置策略 +#### 1. 哪些 URL 应该包含? +基于小说站点的特点,建议优先包含以下页面: + +- **首页**: + - 包含站点的唯一首页 URL(如 `https://www.example.com/`)。 + - 设置高优先级(如 `1.0`)和频繁更新(如 `daily`)。 + +- **分类列表(主页面)**: + - 包含每个分类的主页面(如 `https://www.example.com/category/xuanhuan`)。 + - 排除分页 URL(如 `https://www.example.com/category/xuanhuan?page=2`),因为分页内容重复且 SEO 价值低。 + - 示例:玄幻、言情、历史等分类页面。 + +- **男生/女生频道**: + - 包含频道主页(如 `https://www.example.com/male`、`https://www.example.com/female`)。 + - 如果频道下有子分类(如男生玄幻、女生穿越),也应包含。 + +- **排行榜(精选)**: + - 包含主要排行榜页面(如 `https://www.example.com/rank/hot`、`https://www.example.com/rank/male`)。 + - 如果排行榜页面频繁更新(如每日排行),可设置 `daily`。 + - 排除次要或动态参数页面(如 `?sort=week`),避免重复内容。 + +- **详情页面**: + - 包含所有小说详情页面(如 `https://www.example.com/book/123`)。 + - 这些页面是 SEO 的核心,吸引搜索流量(如用户搜索小说名)。 + - 使用 `` 反映小说更新时间,提示搜索引擎重新抓取。 + +- **目录页面**: + - 包含每个小说的目录页面(如 `https://www.example.com/book/123/chapters`)。 + - 目录页面便于用户导航,且可能被搜索引擎索引为长尾关键词(如“小说名 章节列表”)。 + +- **章节页面(可选)**: + - **不建议全部包含**:小说章节页面数量庞大(可能数十万到数百万),SEO 价值较低(用户很少通过搜索直接进入具体章节)。 + - **可选策略**: + - 只包含最新章节(如最近 30 天的章节),吸引搜索引擎抓取更新内容。 + - 只包含热门小说的前几章(如前 10 章),作为引流入口。 + - 如果包含,设置较低优先级(如 `0.3`)。 + +#### 2. 哪些 URL 应该排除? +- **分页 URL**:如分类列表的 `?page=2`,重复内容无 SEO 价值。 +- **动态参数 URL**:如 `?sort=latest` 或 `?utm_source=...`,应规范化到标准 URL。 +- **不可索引页面**: + - 已设置 `` 的页面。 + - 被 `robots.txt` 屏蔽的页面(如 `Disallow: /user/`)。 +- **用户生成内容**: + - 如评论页、用户个人中心、搜索结果页(`?q=keyword`)。 +- **临时页面**: + - 如促销活动页、测试页面。 +- **错误页面**:如 404、500 页面。 + +--- + +### 三、处理大量 URL 的策略 +小说站点通常有大量 URL(尤其是章节页面),可能超过 Sitemap 的限制(50,000 条 URL 或 50MB)。以下是应对方法: + +#### 1. 使用 Sitemap 索引文件 +- 将 URL 分组到多个子 Sitemap 文件(如 `sitemap-books.xml`、`sitemap-chapters.xml`),每文件不超过 50,000 条 URL。 +- 创建一个 Sitemap 索引文件(如 `sitemap_index.xml`)引用所有子 Sitemap。 +- 示例: + ```xml + + + + https://www.example.com/sitemap-main.xml + 2025-04-21 + + + https://www.example.com/sitemap-books.xml + 2025-04-21 + + + https://www.example.com/sitemap-chapters.xml + 2025-04-21 + + + ``` + +#### 2. 分组策略 +- **按页面类型分组**: + - `sitemap-main.xml`:首页、分类列表、排行榜、男生/女生频道。 + - `sitemap-books.xml`:小说详情页面和目录页面。 + - `sitemap-chapters.xml`:章节页面(如果包含)。 +- **按更新频率分组**: + - 频繁更新的页面(如排行榜、最新章节)单独分组,设置 `daily`。 +- **按小说分组**: + - 为每部小说生成单独的 Sitemap(如 `sitemap-book123.xml`),包含其详情页、目录页和部分章节页。 + +#### 3. 动态生成 Sitemap +- **脚本生成**: + - 使用 Python、PHP 等脚本从数据库查询 URL,生成 Sitemap 文件。 + - 示例(Python,参考前文): + ```python + from lxml import etree + import datetime + + # 模拟数据库查询 + urls = [ + {'loc': 'https://www.example.com/', 'lastmod': '2025-04-21', 'changefreq': 'daily', 'priority': '1.0'}, + {'loc': 'https://www.example.com/book/123', 'lastmod': '2025-04-21', 'changefreq': 'weekly', 'priority': '0.8'}, + {'loc': 'https://www.example.com/book/123/chapters', 'lastmod': '2025-04-21', 'changefreq': 'weekly', 'priority': '0.6'}, + ] + + urlset = etree.Element("urlset", xmlns="http://www.sitemaps.org/schemas/sitemap/0.9") + for url in urls: + url_element = etree.SubElement(urlset, "url") + loc = etree.SubElement(url_element, "loc") + loc.text = url['loc'] + lastmod = etree.SubElement(url_element, "lastmod") + lastmod.text = url['lastmod'] + changefreq = etree.SubElement(url_element, "changefreq") + changefreq.text = url['changefreq'] + priority = etree.SubElement(url_element, "priority") + priority.text = url['priority'] + + tree = etree.ElementTree(urlset) + tree.write("sitemap-main.xml", pretty_print=True, xml_declaration=True, encoding="UTF-8") + ``` + +- **定时任务**: + - 使用 cron 任务每天或每周生成 Sitemap,上传到根目录。 + - 示例(Linux cron): + ```bash + 0 2 * * * python3 /path/to/generate_sitemap.py + ``` + +- **触发式更新**: + - 在小说更新(如新章节发布)时,触发脚本更新相关 Sitemap。 + +#### 4. 伪静态 Sitemap +- 配置服务器将 `sitemap_index.xml` 等请求重定向到动态脚本,实时生成 XML 内容。 +- 示例(Apache + PHP,参考前文): + ```apache + RewriteEngine On + RewriteRule ^sitemap_index\.xml$ sitemap_index.php [L] + ``` + +--- + +### 四、robots.txt 配置 +在 `robots.txt` 中声明 Sitemap 索引文件,使用绝对路径: +```txt +User-agent: * +Disallow: /user/ +Disallow: /search/ +Sitemap: https://www.example.com/sitemap_index.xml +``` + +- 确保不通过 `Disallow` 屏蔽 Sitemap 文件。 +- 如果 Sitemap 托管在 CDN(如 `https://cdn.example.com/sitemap_index.xml`),在 `robots.txt` 中使用 CDN 地址,并验证所有权。 + +--- + +### 五、SEO 优化建议 +1. **优先级设置**: + - 首页:`1.0` + - 分类/频道/详情页:`0.8` + - 目录页:`0.6` + - 章节页(若包含):`0.3` + +2. **更新频率**: + - 首页、排行榜:`daily` + - 分类/频道/详情/目录页:`weekly` + - 章节页:`monthly`(或 `never` 如果不频繁更新) + +3. **规范化 URL**: + - 确保只包含规范 URL(如 `https://www.example.com/book/123` 而非 `http://example.com/book/123`)。 + - 使用 `` 或 Sitemap 统一规范版本。 + +4. **避免重复内容**: + - 排除带参数的 URL(如 `?sort=latest`)。 + - 如果男生/女生频道与分类列表有重复内容,选择主要入口包含在 Sitemap 中。 + +5. **图片 Sitemap(可选)**: + - 为小说封面图片创建图片 Sitemap,优化图片搜索排名。 + - 示例: + ```xml + + https://www.example.com/book/123 + + https://www.example.com/images/book123.jpg + 小说封面 + + + ``` + +--- + +### 六、注意事项 +1. **章节页面数量庞大**: + - 如果每部小说有数百章节,章节页面可能占主导。建议只包含最新或热门章节,或完全排除章节页面,依靠目录页面引导爬虫。 +2. **抓取预算**: + - 小说站点 URL 数量多,需优化 Sitemap 避免浪费搜索引擎的抓取预算。 +3. **动态更新**: + - 小说站点内容更新频繁(如新章节发布),建议动态生成 Sitemap 或频繁更新。 +4. **验证 Sitemap**: + - 提交 `sitemap_index.xml` 到 Google Search Console、Bing Webmaster Tools,检查是否被正确解析。 + - 使用 GSC 的“索引覆盖率”报告,确认重要页面(如详情页)是否被索引。 + +--- + +### 七、示例 Sitemap 配置 +#### 索引文件(`sitemap_index.xml`) +```xml + + + + https://www.example.com/sitemap-main.xml + 2025-04-21 + + + https://www.example.com/sitemap-books.xml + 2025-04-21 + + +``` + +#### 主 Sitemap(`sitemap-main.xml`) +```xml + + + + https://www.example.com/ + 2025-04-21 + daily + 1.0 + + + https://www.example.com/category/xuanhuan + 2025-04-21 + weekly + 0.8 + + + https://www.example.com/male + 2025-04-21 + weekly + 0.8 + + + https://www.example.com/rank/hot + 2025-04-21 + daily + 0.7 + + +``` + +#### 小说 Sitemap(`sitemap-books.xml`) +```xml + + + + https://www.example.com/book/123 + 2025-04-21 + weekly + 0.8 + + + https://www.example.com/book/123/chapters + 2025-04-21 + weekly + 0.6 + + +``` + +--- + +### 八、结论 +- **不需包含所有 URL**:小说站点应优先包含首页、分类列表、男生/女生频道、排行榜、详情页面和目录页面。章节页面可根据需要部分包含或完全排除。 +- **精选策略**:重点包含 SEO 价值高的页面(如详情页),排除分页、动态参数、低价值页面。 +- **大型站点处理**:使用 Sitemap 索引文件和子 Sitemap,按页面类型分组,动态生成以应对大量 URL。 +- **SEO 优化**:设置合理的 `` 和 ``,定期更新 Sitemap,验证索引效果。 + +如果你需要针对小说站点的具体脚本(生成 Sitemap 或伪静态配置)、CMS 插件推荐,或其他细节(如图片 Sitemap、robots.txt 优化),请告诉我! \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/sitemap/robots.txt b/code/app/home/view/videoGpt1/sitemap/robots.txt new file mode 100644 index 0000000..b2fbe98 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/robots.txt @@ -0,0 +1,38 @@ +# 允许的搜索引擎 +User-agent: Baiduspider +Allow: / + +User-agent: 360Spider +Allow: / + +User-agent: Sogou web spider +Allow: / + +User-agent: Sogou inst spider +Allow: / + +User-agent: YisouSpider +Allow: / + +User-agent: Quarkbot +Allow: / + +User-agent: Googlebot +Allow: / + +# 禁止其他爬虫(AI 爬虫常见 UA) +User-agent: GPTBot +Disallow: / + +User-agent: ChatGPT-User +Disallow: / + +User-agent: CCBot +Disallow: / + +User-agent: ClaudeBot +Disallow: / + +User-agent: * +Disallow: / +Sitemap: https://{$DomainModel->d_domain}/sitemap_index.xml \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/sitemap/sitemap-books-catalog.xml b/code/app/home/view/videoGpt1/sitemap/sitemap-books-catalog.xml new file mode 100644 index 0000000..11cbb04 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/sitemap-books-catalog.xml @@ -0,0 +1,20 @@ +{novel:pagerexp page="$Request.route.intPage" limit="40000" +sort_type="news" +d_key="key" +d_val="Novel" +cache_life="3600" func="generateCategoryPager" export_name="resData" /} + + + + + + {foreach $resData.data as $key=>$Novel} + + https://www.{$DomainModel->d_domain}{site:nclurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" order="zheng" page="1"/} + {:date('Y-m-d')} + weekly + 0.8 + + {/foreach} + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/sitemap/sitemap-books.xml b/code/app/home/view/videoGpt1/sitemap/sitemap-books.xml new file mode 100644 index 0000000..fb432c5 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/sitemap-books.xml @@ -0,0 +1,20 @@ +{novel:pagerexp page="$Request.route.intPage" limit="40000" +sort_type="news" +d_key="key" +d_val="Novel" +cache_life="3600" func="generateCategoryPager" export_name="resData" /} + + + + + + {foreach $resData.data as $key=>$Novel} + + https://www.{$DomainModel->d_domain}{site:nurl n_id="$Novel->n_id" n_py="$Novel->n_name_pinyin"/} + {:date('Y-m-d')} + weekly + 0.8 + + {/foreach} + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/sitemap/sitemap-chapters.xml b/code/app/home/view/videoGpt1/sitemap/sitemap-chapters.xml new file mode 100644 index 0000000..3e2f972 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/sitemap-chapters.xml @@ -0,0 +1,18 @@ +{novel:pagerexp page="$Request.route.intPage" limit="40000" +sort_type="news" +d_key="key" +d_val="Novel" +cache_life="3600" func="generateCategoryPager" export_name="resData" /} + + + + {foreach $resData.data as $key=>$Novel} + + https://www.{$DomainModel->d_domain}{site:lcpurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /} + {:date('Y-m-d')} + weekly + 0.6 + + {/foreach} + + diff --git a/code/app/home/view/videoGpt1/sitemap/sitemap-main.xml b/code/app/home/view/videoGpt1/sitemap/sitemap-main.xml new file mode 100644 index 0000000..9027552 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/sitemap-main.xml @@ -0,0 +1,35 @@ + + + + https://www.{$DomainModel->d_domain}/ + {:date('Y-m-d')} + daily + 1.0 + + + + https://www.{$DomainModel->d_domain}{$strRankUrlTemp} + {:date('Y-m-d')} + daily + 1.0 + + + + {novel:category d_key="strCategoryPinyin" d_val="strCategoryName"} + + {novel:sort d_key="sort_key" d_val="strSortName"} + + {novel:status d_key="status_key" d_val="strStatusName"} + + https://www.{$DomainModel->d_domain}{site:nflurl category="$strCategoryPinyin" order="$sort_key" status="$status_key" /} + {:date('Y-m-d')} + weekly + 0.8 + + {/novel:status} + {/novel:sort} + {/novel:category} + + + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/sitemap/sitemap_index.xml b/code/app/home/view/videoGpt1/sitemap/sitemap_index.xml new file mode 100644 index 0000000..338a409 --- /dev/null +++ b/code/app/home/view/videoGpt1/sitemap/sitemap_index.xml @@ -0,0 +1,39 @@ +{novel:pagerexp page="1" limit="40000" +sort_type="news" +d_key="d_key" +d_val="Novel" +cache_life="3600" func="generateCategoryPager" export_name="resData" /} + + + + + https://www.{$DomainModel->d_domain}/sitemap-main.xml + {:date('Y-m-d')} + + + + {for start="0" end="$resData.p_data.pages"} + + https://www.{$DomainModel->d_domain}/sitemap-books-{$i+1}.xml + {:date('Y-m-d')} + + {/for} + + + {for start="0" end="$resData.p_data.pages"} + + https://www.{$DomainModel->d_domain}/sitemap-books-catalog-{$i+1}.xml + {:date('Y-m-d')} + + {/for} + + + {for start="0" end="$resData.p_data.pages"} + + https://www.{$DomainModel->d_domain}/sitemap-chapters-{$i+1}.xml + {:date('Y-m-d')} + + {/for} + + + \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/user/getHistory.html b/code/app/home/view/videoGpt1/user/getHistory.html new file mode 100644 index 0000000..e4be7f0 --- /dev/null +++ b/code/app/home/view/videoGpt1/user/getHistory.html @@ -0,0 +1,104 @@ +{extend name="base" /} + +{block name="get-data"} + +{site:grm page_code="h5_video_search" diff="$Request.url" num="30" g_key="arrGrm" /} +{/block} + +{block name="title"}我的观看记录{/block} +{block name="keywords"}我的观看记录{/block} +{block name="description"}我的观看记录{/block} + + + +{block name="head"} + +{/block} + + +{block name="head-css"} + +{/block} + +{block name="head-js"} + +{/block} + +{block name="main"} +
    + + +
    +
    +
    + +
    +

    观看记录

    +
    + +
    +
      + + +
    +
    +
    + +
    + +
    +
    + + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getCategory.html b/code/app/home/view/videoGpt1/video/getCategory.html new file mode 100644 index 0000000..e9dc361 --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getCategory.html @@ -0,0 +1,135 @@ +{extend name="base" /} + +{block name="get-data"} + +{video:pagerexp page="$Request.route.intPage" limit="30" button_num="10" cache_life="3600" +key="$Request.get.keyword" +v_parent_category_en="$Request.route.strParentCategory" +v_category_en="$Request.route.strCategory" +v_lang_en="$Request.route.strLang" +v_area_en="$Request.route.strArea" +v_year="$Request.route.strYear" +sort_type="$Request.route.strOrder" +d_key="d_key" d_val="Video" p_val="page_data" func="generateVideoPager" export_name="resData" /} + +{site:grm page_code="h5_category_list_type" diff="$Request.route.intPage" num="100" g_key="arrGrm" /} + +{site:helper func="initVideoCategoryTKD" /} + +{/block} + +{block name="title"}{site:replace code="VIDEO@GETCATEGORY@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@GETCATEGORY@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@GETCATEGORY@DESCRIPTION"}{/block} + +{block name="head"} + +{// 社交媒体标签} + + + +{switch $Request.route.strParentCategory } +{case 'dian-ying' } + +{/case} +{case 'dian-shi-ju' } + +{/case} +{case 'zong-yi' } + +{/case} +{case 'dong-man' } + +{/case} +{case 'duan-ju-da-quan' } + +{/case} +{default /} + +{/switch} + +{// 结构化数据} + + + + +{/block} + +{block name="main"} + +
    +

    {$typename}

    + +
    + {volist name="list" id="vo"} + +
    + +
    +
    {$vo.title}
    +
    + {/volist} +
    + +
    {$pages|raw}
    +
    + + + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getCategoryType.html b/code/app/home/view/videoGpt1/video/getCategoryType.html new file mode 100644 index 0000000..c4ff2d9 --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getCategoryType.html @@ -0,0 +1,257 @@ +{extend name="base" /} + +{block name="get-data"} + +{site:grm page_code="h5_category_type" diff="$Request.route.strParentCategory" num="100" g_key="arrGrm" /} + +{site:helper func="initVideoCategoryTypeTKD" /} + +{/block} + +{block name="title"}{site:replace code="VIDEO@GETCATEGORYINDEX@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@GETCATEGORYINDEX@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@GETCATEGORYINDEX@DESCRIPTION"}{/block} + +{block name="head"} + + + + +{switch $Request.route.strParentCategory } +{case 'dian-ying' } + +{/case} +{case 'dian-shi-ju' } + +{/case} +{case 'zong-yi' } + +{/case} +{case 'dong-man' } + +{/case} +{case 'duan-ju-da-quan' } + +{/case} +{default /} + +{/switch} + + + + +{/block} + +{block name="head-css"}{/block} + +{block name="head-js"}{/block} + +{block name="main"} + +
    + +

    + {site:replace code="VIDEO@GETCATEGORYINDEX@H1"} +

    +

    {site:replace code="VIDEO@GETCATEGORYINDEX@TEXT"}

    + + + + +
    +
    +
    +
    +
    +

    最近更新

    +
    +
    +
    +
      + {video:list count="12" + v_parent_category_en="$Request.route.strParentCategory" + sort_type="update" d_key="key" + d_val="Video" cache_life="3600"} + {include file="public/video-list-shu" start="10" col-md="6"/} + {/video:list} +
    +
    +
    +
    + +
    + + + {video:categorytype category_type="ONE" d_key="key" d_val="val"} + {if $val.v_category_en == $Request.route.strParentCategory} + {foreach $val.children as $intChildrenKey=>$arrChildrenCategory } +
    +
    + + +
    +
    + + + +
    +
    +
      + {video:list count="8" v_category_en="$arrChildrenCategory.v_category_en" sort_type="news" d_key="key" + d_val="Video" cache_life="3600"} + {include file="public/video-list-shu" start="27" col-md="4"/} + {/video:list} +
    + +
    +
    + +
    +
    + + {/foreach} + {/if} + {/video:categorytype} + +
    + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getMap.html b/code/app/home/view/videoGpt1/video/getMap.html new file mode 100644 index 0000000..c11901d --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getMap.html @@ -0,0 +1,146 @@ +{extend name="base" /} + +{block name="get-data"} +{video:pagerexp page="$Request.get.page" limit="12" +key="$Request.get.keyword" +d_key="d_key" +d_val="Video" +p_val="page_data" button_num="5" cache_life="3600" func="generateSearchPager" export_name="resData" /} +{site:grm page_code="h5_video_search" diff="0" num="30" g_key="arrGrm" /} +{/block} + + +{block name="title"}{site:replace code="VIDEO@GETSEARCHVIDEO@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@GETSEARCHVIDEO@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@GETSEARCHVIDEO@DESCRIPTION"}{/block} + + +{block name="head"} + + + + + + + + + + +{// 结构化数据} + +{/block} + + +{block name="head-css"} + +{/block} + +{block name="head-js"} + +{/block} + +{block name="main"} + +
    + + + {video:categorytype category_type="ONE" d_key="key" d_val="val"} +
    + + +
    + + +
    +
    + + {/video:categorytype} + + +
    + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getRankIndex.html b/code/app/home/view/videoGpt1/video/getRankIndex.html new file mode 100644 index 0000000..3e6a429 --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getRankIndex.html @@ -0,0 +1,169 @@ +{extend name="base" /} + +{block name="get-data"} + +{site:grm page_code="h5_rank_type" diff="0" num="100" g_key="arrGrm" /} + + +{/block} + +{block name="title"}{site:replace code="VIDEO@GETVIDEORANKINDEX@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@GETVIDEORANKINDEX@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@GETVIDEORANKINDEX@DESCRIPTION"}{/block} + + +{block name="head"} + +{// 社交媒体标签} + + + + + + + + +{/block} + + +{block name="head-css"} + +{/block} + +{block name="head-js"} + +{/block} + +{block name='body-class'}rank-index{/block} + +{block name="main"} + +
    + + +

    + {site:replace code="VIDEO@GETVIDEORANKINDEX@H1"} +

    +

    {site:replace code="VIDEO@GETVIDEORANKINDEX@TEXT"}

    + +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    +
    + {video:ranksort d_key="key" d_val="val"} +
    +
    +
    +

    {$val}排行榜

    +
    +
      + {video:ranklist count="20" + sort_type="weekly" + d_key="key" d_val="Video" cache_life="3600"} + {include file="public/video-list-phb" start="80"/} + {/video:ranklist} +
    +
    +
    + {/video:ranksort} +
    +
    + +
    + + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getRankList.html b/code/app/home/view/videoGpt1/video/getRankList.html new file mode 100644 index 0000000..cd1957a --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getRankList.html @@ -0,0 +1,203 @@ +{extend name="base" /} + +{block name="get-data"} + +{video:ranklistexp page="1" limit="30" +v_parent_category_en="$Request.route.strParentCategory" +v_category_en="$Request.route.strCategory" +sort_type="$Request.route.strSortType" +d_key="key" +d_val="Video" +p_val="page_data" button_num="10" cache_life="3600" export_name="arrVideoRankList" /} + +{site:grm page_code="h5_rank_list_type" diff="$Request.route.intPage" num="100" g_key="arrGrm" /} +{site:helper func="initVideoRankListTKD" /} + +{/block} + +{block name="title"}{site:replace code="VIDEO@GETVIDEORANKLIST@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@GETVIDEORANKLIST@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@GETVIDEORANKLIST@DESCRIPTION"}{/block} + +{block name="head"} + +{// 社交媒体标签} + + + + + + + + + +{/block} + +{block name="head-css"} +{/block} +{block name="head-js"} + +{/block} + +{block name="main"} + +
    + + + +

    + {site:replace code="VIDEO@GETVIDEORANKLIST@H1"} +

    +

    {site:replace code="VIDEO@GETVIDEORANKLIST@TEXT"}

    + +
    +
    +
    +
    + + +
      +
    • + 按类型 +
    • + {video:categorytype category_type="ONE" d_key="key" d_val="val"} + {if $val.v_category_en == $Request.route.strParentCategory} + {foreach $val.children as $intChildrenKey=>$arrChildrenCategory } +
    • + {$arrChildrenCategory.v_category} +
    • + {/foreach} + {/if} + {/video:categorytype} +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
      + {foreach $arrVideoRankList as $key=>$Video} + {include file="public/video-list-shu" start="0" col-md="6"/} + {/foreach} +
    +
    +
    +
    + +
    +
    + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getSearchVideo.html b/code/app/home/view/videoGpt1/video/getSearchVideo.html new file mode 100644 index 0000000..f813ca8 --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getSearchVideo.html @@ -0,0 +1,122 @@ +{extend name="base" /} + +{block name="get-data"} +{video:pagerexp page="$Request.get.page" limit="12" +key="$Request.get.keyword" +d_key="d_key" +d_val="Video" +p_val="page_data" button_num="5" cache_life="3600" func="generateSearchPager" export_name="resData" /} +{site:grm page_code="h5_video_search" diff="0" num="30" g_key="arrGrm" /} +{/block} + + +{block name="title"}{site:replace code="VIDEO@GETSEARCHVIDEO@TITLE"}{/block} +{block name="keywords"}{site:replace code="VIDEO@GETSEARCHVIDEO@KEYWORDS"}{/block} +{block name="description"}{site:replace code="VIDEO@GETSEARCHVIDEO@DESCRIPTION"}{/block} + + +{block name="head"} + + + + + + + + + + +{// 结构化数据} + +{/block} + + +{block name="head-css"} + +{/block} + +{block name="head-js"} + +{/block} + +{block name="main"} + +{include file="header" /} + +
    +

    搜索结果:{$wd}

    + +
    + {volist name="list" id="vo"} + +
    + +
    +
    {$vo.title}
    +
    + {/volist} +
    +
    + +{include file="footer" /} + + +{/block} +{block name="customize"} + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getVideoInfo.html b/code/app/home/view/videoGpt1/video/getVideoInfo.html new file mode 100644 index 0000000..80d82b2 --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getVideoInfo.html @@ -0,0 +1,219 @@ +{extend name="base" /} + +{block name="get-data"} + +{if $Request.route.intVId && $Request.route.intVForgeId} +{video:info v_id="$Request.route.intVId" v_key="arrVideo" v_fid="$Request.route.intVForgeId" /} +{elseif $Request.route.intVId} +{video:info v_id="$Request.route.intVId" v_key="arrVideo" /} +{else} +{video:info v_id="$DomainModel->info_id" n_key="arrVideo" /} +{/if} +{site:grm page_code="h5_video_info" diff="$arrVideo.v_id" num="120" g_key="arrGrm" /} + +{/block} + +{block name="title"} +{if $DomainModel->info_id == $Request.route.intVId || empty($Request.route.intVId)} +{site:replace code="VIDEO@INDEX@INDEX@TITLE"} +{else} +{site:replace code="VIDEO@GETVIDEOINFO@TITLE" diff="$Request.route.intVId" /} +{/if} +{/block} + + +{block name="keywords"} +{if $DomainModel->info_id == $Request.route.intVId || empty($Request.route.intVId)} +{site:replace code="VIDEO@INDEX@INDEX@KEYWORDS"} +{else} +{site:replace code="VIDEO@GETVIDEOINFO@KEYWORDS" diff="$Request.route.intVId"} +{/if} +{/block} + +{block name="description"} +{if $DomainModel->info_id == $Request.route.intVId || empty($Request.route.intVId)} +{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION"} +{else} +{site:replace code="VIDEO@GETVIDEOINFO@DESCRIPTION" diff="$Request.route.intVId"} +{/if} +{/block} + + +{block name="head"} + +{// Open Graph 协议(用于Facebook、LinkedIn等)} + + +{switch $arrVideo.v_parent_category_en } +{case 'dian-ying' } + +{/case} +{case 'dian-shi-ju' } + +{/case} +{case 'zong-yi' } + +{/case} +{case 'dong-man' } + +{/case} +{case 'duan-ju-da-quan' } + +{/case} +{default /} + +{/switch} + + + + + +{// Twitter Card(用于Twitter/X)} + + + + + +{if $Request.route.intVId && $Request.route.intVForgeId} + +{/if} + +{// 结构化数据} + +{/block} + +{block name='body-class'}video-info-page{/block} + +{block name="strPageCode"} + +{/block} + +{block name="main"} + +
    + +
    +
    + +
    + +
    +

    {$info.title}

    +
    {$info.year} · {$info.area} · {$info.type}
    + + +

    + {php}$desc = \app\common\helper\TextSpin::spin($info['intro'], $style['theme_id']);{/php} + {$desc} +

    + + 开始播放 +
    +
    + +

    剧集列表

    +
    + {volist name="episodes" id="vo"} + 第{$vo.n}集 + {/volist} +
    + +
    + + + + + +{/block} +{block name="customize"} {/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html b/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html new file mode 100644 index 0000000..e86e81e --- /dev/null +++ b/code/app/home/view/videoGpt1/video/getVideoPlayUrl.html @@ -0,0 +1,191 @@ +{extend name="base" /} + +{block name="get-data"} + +{video:info v_id="$Request.route.intVId" v_key="arrVideo" /} +{site:grm page_code="h5_video_info" diff="$arrVideo.v_id" num="120" g_key="arrGrm" /} + +{/block} + +{block name="title"} +{site:replace code="VIDEO@GETVIDEOPLAY@TITLE" diff="$Request.route.intVId" /} +{/block} + +{block name="keywords"} +{site:replace code="VIDEO@GETVIDEOPLAY@KEYWORDS" diff="$Request.route.intVId"} +{/block} + +{block name="description"} +{site:replace code="VIDEO@GETVIDEOPLAY@DESCRIPTION" diff="$Request.route.intVId"} +{/block} + +{block name="head"} + +{// Open Graph 协议(用于Facebook、LinkedIn等)} + + +{switch $arrVideo.v_parent_category_en } +{case 'dian-ying' } + +{/case} +{case 'dian-shi-ju' } + +{/case} +{case 'zong-yi' } + +{/case} +{case 'dong-man' } + +{/case} +{case 'duan-ju-da-quan' } + +{/case} +{default /} + +{/switch} + + + + + +{// Twitter Card(用于Twitter/X)} + + + + + +{if $Request.route.intVId && $Request.route.intVForgeId} + +{/if} + + +{// 结构化数据} + +{/block} + +{block name="head-css"} + + +{/block} + + +{block name='body-class'}video-play-page{/block} + +{block name="strPageCode"} + +{/block} + +{block name="main"} + +
    +
    + {$player_code|raw} +
    + +

    选集

    +
    + {volist name="episodes" id="vo"} + + 第{$vo.n}集 + + {/volist} +
    +
    + + + + + + + +{/block} + +{block name="customize"} + +{/block} + + +{block name="footer-js"} + + + +{/block} \ No newline at end of file diff --git a/code/app/home/view/videoGpt1/推广优化记录/首页/上先前ai排查.md b/code/app/home/view/videoGpt1/推广优化记录/首页/上先前ai排查.md new file mode 100644 index 0000000..c228b21 --- /dev/null +++ b/code/app/home/view/videoGpt1/推广优化记录/首页/上先前ai排查.md @@ -0,0 +1,292 @@ +以下是对提供的视频站点首页(`video2.com`)SEO优化的分析和建议,重点针对中国大陆的浏览搜索排名(如百度),结合同行影视站点的常见优化策略,确保排名提升至首页。分析涵盖现有代码的优点、不足,并提供具体改进建议。 + +--- + +### 现有SEO优点 +1. **TKD(Title, Keywords, Description)设置**: + - 标题包含核心关键词(如“大地资源网在线观看免费官网”“2024大地影院免费高清电视剧大全”),长度适中(约60字符),符合百度要求。 + - 关键词和描述包含热门搜索词(如“免费视频”“高清电视剧”),与影视站点用户搜索习惯高度相关。 + - 使用`{{{video_type}}}`占位符,动态插入内容(如“动作片”),提升页面相关性。 + +2. **结构化数据**: + - 包含`WebSite`、`VideoObject`和`CollectionPage`的JSON-LD结构化数据,增强百度富媒体展示(如视频缩略图、评分)。 + - `ItemList`列出具体影片,包含名称、描述、演员、图片等,利于搜索引擎理解内容。 + +3. **站内链接**: + - 导航链接(如`/vodtype/dian-ying`)和内容链接(如`/voddetail/wu-ren-guo-jing-140361`)结构清晰,URL规范化,利于爬虫抓取。 + - 提供“更多”链接(如`/vodtype-dian-ying/all-all-all-all/all-page1`),引导用户深入浏览,增加页面权重。 + +4. **Sitemap和Robots**: + - 提供多种地图链接(XML、RSS、百度Sitemap等),便于搜索引擎快速收录。 + - `robots.txt`支持,明确爬虫规则。 + +5. **响应式设计**: + - 使用`meta viewport`和响应式网格(如`col-lg-4 col-md-4`),适配PC和移动端,提升用户体验和移动端排名。 + +6. **社交媒体标签**: + - `og:title`、`og:description`等Open Graph标签支持社交媒体分享,增加外部流量来源。 + +--- + +### SEO不足及优化建议 +以下是首页SEO的不足之处及具体改进建议,针对中国大陆影视站点特点(如百度算法偏好)优化。 + +#### 1. **标题(Title)优化** +**问题**: +- 标题过长(约70字符,含“https://video1.com-大地”),可能被截断,影响展示效果。 +- 包含重复关键词(如“大地”出现多次),降低关键词密度效率。 +- 包含无关域名(`https://video1.com`),与实际域名(`video2.com`)不一致,易引起搜索引擎混淆。 + +**建议**: +- 精简标题,控制在60字符以内,突出核心关键词,避免重复。 +- 移除无关域名,使用实际域名(`video2.com`)增强品牌一致性。 +- 示例优化标题: + ```html + 大地影视-2024免费高清电影电视剧在线观看-video2.com + ``` + +#### 2. **关键词(Keywords)优化** +**问题**: +- 关键词列表较长,部分词(如“短视频”“预告片”)与主站内容(电影、电视剧)相关性较低。 +- 关键词堆砌(如“大地影院大全在线观看”“大地”),可能被百度视为过度优化。 +- 未包含长尾关键词(如“免费电影在线观看”“2024最新电视剧”),错失精准流量。 + +**建议**: +- 精选5-8个高相关性关键词,包含品牌词(如“大地影视”)和长尾词。 +- 避免重复和无关词,突出用户搜索意图。 +- 示例优化关键词: + ```html + + ``` + +#### 3. **描述(Description)优化** +**问题**: +- 描述过长(约180字符),可能被截断,影响点击率。 +- 包含无效URL(`www.https://video1.com`),格式错误,降低可信度。 +- 关键词堆砌(如“大地影视”重复出现),未突出独特卖点(如“无广告”)。 +- `{{{video_type}}}`占位符在首页可能未正确替换,导致描述不完整。 + +**建议**: +- 控制描述在120-160字符,简洁突出免费、高清、无广告等卖点。 +- 修正URL为`video2.com`,确保一致性。 +- 确保`{{{video_type}}}`在首页有默认值(如“电影”)或移除。 +- 示例优化描述: + ```html + + ``` + +#### 4. **URL规范化** +**问题**: +- 页面URL(`https://video2.com`)与描述中的`https://video1.com`不一致,可能导致权重分散。 +- 部分链接(如`/news/52050.html`)指向非视频内容,降低页面主题相关性。 +- 热门搜索链接(如`/news/52050.html`)重复指向同一页面,浪费爬虫资源。 + +**建议**: +- 统一使用`https://video2.com`作为规范URL,添加`rel="canonical"`标签: + ```html + + ``` +- 将热门搜索链接改为视频详情页(如`/voddetail/gu-mu-li-ying-guo-yu-140357`),提高相关性。 +- 检查站内链接,确保无404或重定向错误。 + +#### 5. **结构化数据改进** +**问题**: +- `VideoObject`的`thumbnailUrl`指向详情页URL而非图片URL,格式错误。 +- `uploadDate`格式为`25-05-08`,不符ISO 8601标准(如`2025-05-08`)。 +- 部分影片描述为空(如“铁鹰战士4”),影响富媒体展示效果。 +- `aggregateRating`的`ratingValue`多为`0.0`,缺乏真实评分数据。 + +**建议**: +- 修正`thumbnailUrl`为实际图片URL(如`/img/video/2025/01/27/22/wu-ren-guo-jing.webp`)。 +- 规范化`uploadDate`为`YYYY-MM-DD`格式。 +- 为每部影片补充简短描述(50-100字),提高信息完整性。 +- 若无真实评分,移除`aggregateRating`或用默认值(如`5.0`)。 +- 示例优化片段: + ```json + { + "@context": "https://schema.org", + "@type": "VideoObject", + "name": "大地影视热门推荐预告片", + "description": "观看大地影视最新电影和电视剧的精彩预告片!", + "thumbnailUrl": "https://video2.com/img/video/2025/01/27/22/wu-ren-guo-jing.webp", + "uploadDate": "2025-05-08", + "publisher": { + "@type": "Organization", + "name": "大地影视" + } + } + ``` + +#### 6. **内容优化** +**问题**: +- 首页内容偏少,部分模块(如“最新电视剧”“最新综艺”)的`
      `为空,降低页面信息量。 +- 影片简介过长(如“无人过境”超300字),可能影响加载速度和用户体验。 +- 缺少关键词密度优化,核心词(如“免费观看”“高清影视”)出现频率低。 + +**建议**: +- 填充空模块,至少展示3-5条内容,增加页面信息量。 +- 简介控制在100-150字,超出部分移至详情页,首页仅展示摘要。 +- 在`

      `、`

      `中适度插入关键词(如“免费高清电影”),但避免堆砌。 +- 示例优化影片项: + ```html +

      +

      + 无人过境 +

      + +
      + ``` + +#### 7. **导航优化** +**问题**: +- 导航下拉菜单(如“电影”“电视剧”)的子项链接(如`/vodtype-all/dong-zuo-pian-all-all-all/all-page1`)层级过深,增加爬虫抓取难度。 +- 热门搜索模块的链接指向`/news`而非视频详情页,降低转化率。 +- 导航未使用面包屑导航,影响用户体验和SEO权重传递。 + +**建议**: +- 简化URL层级,如将`/vodtype-all/dong-zuo-pian-all-all-all/all-page1`改为`/movie/action/page1`。 +- 将热门搜索链接指向视频详情页(如`/voddetail/gu-mu-li-ying-guo-yu-140357`)。 +- 添加面包屑导航: + ```html + + ``` + +#### 8. **图片优化** +**问题**: +- 图片未使用`alt`属性(如``或背景图),错失关键词优化机会。 +- 图片URL(如`/img/video/2025/01/27/22/wu-ren-guo-jing.webp`)未压缩,增加加载时间。 +- 懒加载属性(`data-src`)未全面覆盖,可能影响首屏加载。 + +**建议**: +- 为所有图片添加`alt`属性,包含关键词: + ```html + + 无人过境免费高清电影海报 + + ``` +- 使用工具(如TinyPNG)压缩图片,减少文件大小。 +- 确保所有图片使用`data-src`和`data-original`,并验证懒加载脚本有效。 + +#### 9. **加载速度优化** +**问题**: +- 加载多个CSS文件(`plugins.css`、`global.css`等),增加HTTP请求。 +- JS文件(如`jquery-3.7.1.min.js`)未使用defer或async,阻塞渲染。 +- 百度推送脚本重复加载(``和``各一次)。 + +**建议**: +- 合并CSS文件为单一文件,减少请求: + ```html + + ``` +- 为非关键JS添加`defer`或`async`: + ```html + + ``` +- 删除重复的百度推送脚本,仅保留``中的: + ```html + + ``` + +#### 10. **移动端体验** +**问题**: +- 移动端搜索表单的占位符(“输入主演名或影片名”)未突出免费观看优势。 +- 部分模块(如“好莱坞榜单”)在移动端隐藏(`hidden-xs`),减少信息量。 +- 未启用AMP(加速移动页面)或PWA(渐进式Web应用)。 + +**建议**: +- 修改搜索占位符,突出卖点: + ```html + + ``` +- 在移动端显示简版榜单(如前3项),增加内容: + ```html + + ``` +- 考虑引入AMP版本(如`/amp/index.html`)或PWA,提升移动端加载速度和用户留存。 + +#### 11. **外部链接与友链** +**问题**: +- 友情链接模块(`