小说第一模板 url 设计

This commit is contained in:
make
2025-03-31 09:29:56 +08:00
parent faf1b5d315
commit c3b0fd14d1
10 changed files with 258 additions and 34 deletions

View File

@@ -24,13 +24,19 @@ Route::get('/pc/bookshelf', [User::class,'getBookShelf'])->ext('html')->append([
Route::get('paihang/all', [Novel::class,'getNovelRank'])->append(['boolIsMobile' => true]); Route::get('paihang/all', [Novel::class,'getNovelRank'])->append(['boolIsMobile' => true]);
Route::get("/pc/paihang/all", [Novel::class,'getNovelRank'])->append(['boolIsMobile' => false]); Route::get("/pc/paihang/all", [Novel::class,'getNovelRank'])->append(['boolIsMobile' => false]);
// 男生/女生 - grok 推荐最优方案 /**
* 男生/女生 - grok 推荐最优方案
*
*/
Route::get('/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); Route::get('/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']);
Route::get('/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); Route::get('/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
Route::get('/pc/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); Route::get('/pc/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']);
Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
// 书库 - grok 推荐最优方案 /shuku/channel-category-status-page /**
* 书库 - grok 推荐最优方案
* /shuku/channel-category-status-page
*/
Route::get('/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => true]); Route::get('/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => true]);
Route::get('/pc/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => false]); Route::get('/pc/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => false]);
Route::get('/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary']) Route::get('/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary'])
@@ -74,17 +80,13 @@ Route::get('/pc/article/list', [Novel::class,'getArticleList'])->ext('html')->ap
Route::get('/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => true]); Route::get('/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => true]);
Route::get('/pc/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => false]); Route::get('/pc/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => false]);
// 小说详情 /**
Route::get('/info/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => true]); * 小说详情
Route::get('/pc/info/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => false]); * /book/{strPinYin}-{intNId}.html
Route::get('/novel/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => true]); * /novel/{strPinYin}-{intNId}.html
Route::get('/pc/novel/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => false]); * /novel-{strPinYin}-{intNId}.html
* /book-{strPinYin}-{intNId}.html
// example */
// /book/{strPinYin}-{intNId}.html
// /novel/{strPinYin}-{intNId}.html
// /novel-{strPinYin}-{intNId}.html
// /book-{strPinYin}-{intNId}.html
Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo']) Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo'])
->append(['boolIsMobile' => false, 'intUriType' => 1]) ->append(['boolIsMobile' => false, 'intUriType' => 1])
->pattern(['n_id' => '\d+','name' => '[\w-]+',]) ->pattern(['n_id' => '\d+','name' => '[\w-]+',])
@@ -110,17 +112,34 @@ Route::get('/pc/books/:name-:n_id/chapter/latest', [Novel::class, 'getNovelNewsC
->append(['boolIsMobile' => false, 'intUriType' => 1]) ->append(['boolIsMobile' => false, 'intUriType' => 1])
->pattern(['n_id' => '\d+','name' => '[\w-]+',]) ->pattern(['n_id' => '\d+','name' => '[\w-]+',])
->ext('html'); ->ext('html');
// 小说章节
Route::get('chapter/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => true]);
Route::get('/pc/chapter/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => false]);
Route::get('/pc/books/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => false]);
// 小说目录 /**
Route::get('/chapters/:intNovelId-[:intPage]-[:strSort]', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => true]); * 小说章节
Route::get('pc/chapters/:intNovelId-[:intPage]-[:strSort]', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => false]); * /xiaoshuo/小说拼音-小说id/zhang-章节排序/章节分页
Route::get('/chapters', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => true]); * /xiaoshuo/小说拼音-小说id/di-章节排序-zhang/章节分页
Route::get('pc/chapters', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => false]); */
Route::get('/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter'])
->append(['boolIsMobile' => true, 'intUriType' => 1])
->pattern(['intNovelId' => '\d+','name' => '[\w-]+','intChapterId' => '\d+','intChapterPage' => '\d+']);
Route::get('/pc/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter'])
->append(['boolIsMobile' => false, 'intUriType' => 1])
->pattern(['intNovelId' => '\d+','name' => '[\w-]+','intChapterSort' => '\d+','intChapterPage' => '\d+']);
/**
* 小说目录页面
* /xiaoshuo/[name]-[novel-id]/mulu/order/[page]
*/
Route::get('/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll'])
->append(['boolIsMobile' => true, 'intUriType' => 1])
->pattern(['intNovelId' => '\d+','name' => '[\w-]+','strOrder' => 'zheng|dao','intPage' => '\d+']);
Route::get('/pc/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll'])
->append(['boolIsMobile' => false, 'intUriType' => 1])
->pattern(['intNovelId' => '\d+','name' => '[\w-]+','strOrder' => 'zheng|dao','intPage' => '\d+']);
// 搜索小说 // 搜索小说
Route::get('search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); Route::get('search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]);

View File

@@ -387,8 +387,16 @@ class Novel extends BaseController
} }
// 小说章节 /**
public function getNovelChapter(Request $Request, $intNovelId = 1, $intChapterId = 1, $intChapterPage = 1) * 小说章节
*
* @param Request $Request
* @param integer $intNovelId 小说id
* @param integer $intChapterSort 章节排序 序号
* @param integer $intChapterPage 每个章节的分页
* @return void
*/
public function getNovelChapter(Request $Request, $intNovelId = 1, $intChapterSort = 1, $intChapterPage = 0)
{ {
$boolIsMobile = $Request->param('boolIsMobile'); $boolIsMobile = $Request->param('boolIsMobile');
@@ -406,7 +414,10 @@ class Novel extends BaseController
View::assign([ View::assign([
'arrNewsNovel' => $arrNewsNovel, 'arrNewsNovel' => $arrNewsNovel,
'strPageCode' => 'boy' 'strPageCode' => 'boy',
'intNovelId' => $intNovelId,
'intChapterSort' => $intChapterSort,
'intChapterPage' => $intChapterPage,
]); ]);
if ($boolIsMobile) { if ($boolIsMobile) {
return View::fetch(); return View::fetch();
@@ -415,8 +426,16 @@ class Novel extends BaseController
} }
} }
// 小说章节-所有章节 /**
public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strSort = 'asc') * 小说目录页面
*
* @param Request $Request
* @param [type] $intNovelId 小说id
* @param integer $intPage 目录分页
* @param string $strOrder 正序倒叙:zheng/dao
* @return void
*/
public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strOrder = 'zheng')
{ {
$boolIsMobile = $Request->param('boolIsMobile'); $boolIsMobile = $Request->param('boolIsMobile');
// 模拟数据 // 模拟数据
@@ -433,7 +452,9 @@ class Novel extends BaseController
View::assign([ View::assign([
'arrNovelChapterAll' => $arrNovelChapterAll, 'arrNovelChapterAll' => $arrNovelChapterAll,
'strSort' => $strSort, 'intNovelId' => $intNovelId,
'intPage' => $intPage,
'strOrder' => $strOrder,
'strPageCode' => 'chapters', 'strPageCode' => 'chapters',
]); ]);
if ($boolIsMobile) { if ($boolIsMobile) {

View File

@@ -6,7 +6,35 @@
{block name="main"} {block name="main"}
<div class="content"> <div class="content">
<nav class="breadcrumb" aria-label="breadcrumb">
<ol itemscope itemtype="https://schema.org/BreadcrumbList">
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/" itemprop="item">
<span itemprop="name">首页</span>
</a>
<meta itemprop="position" content="1" />
</li>
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/xiaoshuo" itemprop="item">
<span itemprop="name">小说</span>
</a>
<meta itemprop="position" content="2" />
</li>
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/xiaoshuo/doupo-123/mulu/1" itemprop="item">
<span itemprop="name">斗破苍穹</span>
</a>
<meta itemprop="position" content="3" />
</li>
<li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<span itemprop="name">第45章</span>
<meta itemprop="position" content="4" />
</li>
</ol>
</nav>
<div class="con_box"> <div class="con_box">
<div class="top"> <div class="top">
<h3><a href="/pc/novel/334.html" target="_blank">落魄千金美食发家日常</a></h3> <h3><a href="/pc/novel/334.html" target="_blank">落魄千金美食发家日常</a></h3>
<p>作者:鱼昆子</p> <p>作者:鱼昆子</p>
@@ -16,7 +44,7 @@
<div class="fL_con"> <div class="fL_con">
<ul> <ul>
{foreach $arrNovelChapterAll as $category} {foreach $arrNovelChapterAll as $category}
<li><a href="/pc/chapter/1-1-1.html" target="_blank">1 穿越</a></li> <li><a href="/pc/xiaoshuo/name-1/zhang-1" target="_blank">1 穿越</a></li>
{/foreach} {/foreach}
</ul> </ul>
</div> </div>

View File

@@ -6,6 +6,30 @@
{block name="main"} {block name="main"}
<div class="content"> <div class="content">
<nav class="breadcrumb" aria-label="breadcrumb">
<ol itemscope itemtype="https://schema.org/BreadcrumbList">
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/" itemprop="item">
<span itemprop="name">首页</span>
</a>
<meta itemprop="position" content="1" />
</li>
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/xiaoshuo" itemprop="item">
<span itemprop="name">小说</span>
</a>
<meta itemprop="position" content="2" />
</li>
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/xiaoshuo/doupo-123/mulu/1" itemprop="item">
<span itemprop="name">斗破苍穹</span>
</a>
<meta itemprop="position" content="3" />
</li>
</ol>
</nav>
<!--书的信息 开始--> <!--书的信息 开始-->
<div class="info"> <div class="info">
<div class="info_box"> <div class="info_box">
@@ -56,8 +80,8 @@
</div> </div>
</div> </div>
<div class="c04"> <div class="c04">
<a href="/pc/chapter/1-1-1.html" target="_blank" class="read">立即阅读</a> <a href="/pc/xiaoshuo/name-1/zhang-1" target="_blank" class="read">立即阅读</a>
<a href="/pc/chapters.html" target="_blank" class="mulu">目录</a> <a href="/pc/xiaoshuo/xiaos-pin-yin-1/mulu/zheng" target="_blank" class="mulu">目录</a>
</div> </div>
<!-- <div class="c05"> <!-- <div class="c05">
<p class="c05_t">作品标签: <p class="c05_t">作品标签:
@@ -98,8 +122,10 @@
<h2>最新章节</h2> <h2>最新章节</h2>
</div> </div>
<div class="zj_con"> <div class="zj_con">
<p><a href="/chapter/1-1-1.html" target="_blank" class="zj">老读者必看公告!!!</a><span <p>
class="time">3天前</span></p> <a href="/xiaoshuo/小说拼音-intNovelId/zhang-intChapterSort" target="_blank" class="zj">老读者必看公告!!!</a>
<span class="time">3天前</span>
</p>
<p class="zw" style="max-height: 98px; overflow: hidden;"></p> <p class="zw" style="max-height: 98px; overflow: hidden;"></p>
</div> </div>
</div> </div>

View File

@@ -8,6 +8,7 @@
<meta name="description" content="狂雨小说"> <meta name="description" content="狂雨小说">
<title>狂雨小说</title> <title>狂雨小说</title>
<link rel="stylesheet" href="/template/kuangyu/home/bai_web/css/style.css" type="text/css"> <link rel="stylesheet" href="/template/kuangyu/home/bai_web/css/style.css" type="text/css">
<link rel="stylesheet" href="/template/kuangyu/public/css/common.css" type="text/css">
<link rel="stylesheet" href="/public/layer/need/layer.css" type="text/css"> <link rel="stylesheet" href="/public/layer/need/layer.css" type="text/css">
{block name="head-css"}{/block} {block name="head-css"}{/block}
{block name="head-js"}{/block} {block name="head-js"}{/block}

View File

@@ -5,6 +5,7 @@
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>狂雨小说</title> <title>狂雨小说</title>
<link href="/template/kuangyu/user/web/css/user.css" rel="stylesheet"> <link href="/template/kuangyu/user/web/css/user.css" rel="stylesheet">
<link rel="stylesheet" href="/template/kuangyu/public/css/common.css" type="text/css">
</head> </head>
<body style=""> <body style="">

View File

@@ -0,0 +1,37 @@
```
最终推荐
推荐URL/xiaoshuo/[name]-[novel-id]/mulu/[order]/[page]
示例:
正序:/xiaoshuo/doupo-123/mulu/zheng/1
倒序:/xiaoshuo/doupo-123/mulu/dao/1
长拼音名:/xiaoshuo/zhong-sheng-zhi-dao-zun-456/mulu/dao/1
理由:
SEO最佳
xiaoshuo 和 mulu 保留核心关键词。
zheng 和 dao 是拼音,匹配“正序目录”“倒序目录”搜索。
语义清晰:
/mulu/zheng/1 直观表示“目录 正序 第1页”。
一致性:
与章节页(/xiaoshuo/doupo-123/zhang-45/1的拼音风格统一。
分页和排序分离:
[order] 和 [page] 分开,便于扩展其他筛选。
```
## SEO优化建议
标题:
<title>斗破苍穹 章节目录 - 全集在线阅读 - 网站名</title>
元描述:
<meta name="description" content="斗破苍穹章节目录,完整小说章节列表,免费在线阅读最新更新!">
H1标签
<h1>斗破苍穹 章节目录</h1>
面包屑:
首页 > 小说 > 斗破苍穹 > 章节目录
内部链接:
目录页链接到每个章节(如 /xiaoshuo/doupo-123/zhang-45/1提升内链权重。
Canonical标签
<link rel="canonical" href="https://www.example.com/xiaoshuo/doupo-123/mulu/1">
Sitemap
包含所有目录页URL如 /xiaoshuo/doupo-123/mulu/1、/xiaoshuo/doupo-123/mulu/2提交搜索引擎。

View File

@@ -0,0 +1,25 @@
# 小说章节页面 设计记录 grok反馈
最终推荐
推荐URL/xiaoshuo/[name]-[novel-id]/zhang-[chapter-sort]/[page]
示例:
/xiaoshuo/doupo-123/zhang-45/1
/xiaoshuo/zhong-sheng-zhi-dao-zun-456/zhang-45/1
理由:
SEO最佳
xiaoshuo 和 zhang 是高频搜索词,提升通用性。
name如 doupo匹配小说名搜索。
chapter-sort如 45匹配“第X章”。
长拼音优化:
zhong-sheng-zhi-dao-zun 已用 - 分割,语义清晰,匹配“重生 至尊”。
统一性:
PC和H5共用URL通过 request()->isMobile() 动态渲染。
简洁性:
去掉 intChapterId假设 chapterSort 足以标识章节。
## SEO优化建议
标题:<title>斗破苍穹 第45章 - 小说在线阅读 - 网站名</title>
元描述:<meta name="description" content="斗破苍穹 第45章在线阅读最新章节免费更新快来体验">
面包屑:首页 > 小说 > 斗破苍穹 > 第45章
Canonical<link rel="canonical" href="https://www.example.com/xiaoshuo/doupo-123/zhang-45/1">

View File

@@ -559,3 +559,4 @@ display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margi
.info2_L .news .comB .rbtn a{float: left;} .info2_L .news .comB .rbtn a{float: left;}
.info2_L .news .comB .rbtn img{width: 12px; height: 12px; margin: 4px 4px 0 0; float: left;} .info2_L .news .comB .rbtn img{width: 12px; height: 12px; margin: 4px 4px 0 0; float: left;}
.info2_L .news .comB .rbtn a i{float: left;color: #9e9e9e;font-size: 12px;} .info2_L .news .comB .rbtn a i{float: left;color: #9e9e9e;font-size: 12px;}

View File

@@ -0,0 +1,65 @@
/* 面包屑容器 */
.breadcrumb {
font-family: Arial, sans-serif;
padding: 10px 15px;
background-color: #f8f9fa;
border-radius: 5px;
margin: 10px 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
/* 有序列表样式 */
.breadcrumb ol {
list-style: none;
margin: 0;
padding: 0;
display: flex;
align-items: center;
flex-wrap: wrap;
}
/* 面包屑项 */
.breadcrumb-item {
font-size: 14px;
color: #666;
}
/* 链接样式 */
.breadcrumb-item a {
text-decoration: none;
color: #007bff;
transition: color 0.3s ease;
}
.breadcrumb-item a:hover {
color: #0056b3;
text-decoration: underline;
}
/* 分隔符 */
.breadcrumb-item + .breadcrumb-item::before {
content: ">";
margin: 0 8px;
color: #999;
font-weight: bold;
}
/* 当前页面样式 */
.breadcrumb-item.active {
color: #333;
font-weight: bold;
}
/* 响应式调整 */
@media (max-width: 768px) {
.breadcrumb {
padding: 8px 10px;
}
.breadcrumb-item {
font-size: 12px;
}
.breadcrumb-item + .breadcrumb-item::before {
margin: 0 5px;
}
}