debug
This commit is contained in:
@@ -135,13 +135,16 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<div class="chapter-page-btn">
|
<div class="chapter-page-btn">
|
||||||
{$arrGrm[1]|raw}
|
{$arrGrm[1]|raw}
|
||||||
<ul>
|
<ul>
|
||||||
{if $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<li><a href='javascript:'>上一页</a></li>
|
<li><a href='javascript:'>上一页</a></li>
|
||||||
{elseif $arrChapter['pre_chapter'] && $arrChapter['pre_chapter']['c_sort_num']}
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
<li><a
|
<li><a
|
||||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a></li>
|
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a></li>
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
<li><a
|
<li><a
|
||||||
@@ -160,13 +163,16 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<div class="chapter-page-btn">
|
<div class="chapter-page-btn">
|
||||||
{$arrGrm[5]|raw}
|
{$arrGrm[5]|raw}
|
||||||
<ul>
|
<ul>
|
||||||
{if $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<li><a href='javascript:'>上一页</a></li>
|
<li><a href='javascript:'>上一页</a></li>
|
||||||
{elseif $arrChapter['pre_chapter'] && $arrChapter['pre_chapter']['c_sort_num']}
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
<li><a
|
<li><a
|
||||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a></li>
|
<li class="mulu"><a href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a></li>
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
<li><a
|
<li><a
|
||||||
|
|||||||
@@ -101,20 +101,25 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<div class="read_btn">
|
<div class="read_btn">
|
||||||
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<a id="j_chapterPrev" href="javascript:void(0);">上一页</a>
|
<a id="j_chapterPrev" href="javascript:void(0);">上一页</a>
|
||||||
{else}
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
{$arrGrm[10]|raw}
|
{$arrGrm[10]|raw}
|
||||||
<a id="j_chapterPrev"
|
<a id="j_chapterPrev"
|
||||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<a
|
<a
|
||||||
href='{$strPcPath}{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a>
|
href='{$strPcPath}{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
|
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
{$arrGrm[9]|raw}
|
{$arrGrm[9]|raw}
|
||||||
<a id="j_chapterNext"
|
<a id="j_chapterNext"
|
||||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一页</a>
|
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一页</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{$arrGrm[3]|raw}
|
{$arrGrm[3]|raw}
|
||||||
<script>document.writeln(qsbs.bb('{$arrChapter.c_content}'));</script>
|
<script>document.writeln(qsbs.bb('{$arrChapter.c_content}'));</script>
|
||||||
@@ -138,15 +143,19 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<div class="read_btn">
|
<div class="read_btn">
|
||||||
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<a id="j_chapterPrev" href="javascript:void(0);">上一页</a>
|
<a id="j_chapterPrev" href="javascript:void(0);">上一页</a>
|
||||||
{else}
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
{$arrGrm[10]|raw}
|
{$arrGrm[10]|raw}
|
||||||
<a id="j_chapterPrev"
|
<a id="j_chapterPrev"
|
||||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一页</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<a
|
<a
|
||||||
href='{$strPcPath}{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a>
|
href='{$strPcPath}{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节目录</a>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
|
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
{$arrGrm[9]|raw}
|
{$arrGrm[9]|raw}
|
||||||
<a id="j_chapterNext"
|
<a id="j_chapterNext"
|
||||||
|
|||||||
@@ -126,9 +126,11 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
</h1>
|
</h1>
|
||||||
<h1 class="headline">{$arrChapter.c_name ?? ''}</h1>
|
<h1 class="headline">{$arrChapter.c_name ?? ''}</h1>
|
||||||
<div class="pager">
|
<div class="pager">
|
||||||
{if $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<a class="url_pre" id="pb_prev" href='javascript:'>上一页</a>
|
<a class="url_pre" id="pb_prev" href='javascript:'>上一页</a>
|
||||||
{elseif $arrChapter['pre_chapter'] && $arrChapter['pre_chapter']['c_sort_num']}
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
<a class="url_pre" id="pb_prev"
|
<a class="url_pre" id="pb_prev"
|
||||||
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上页</a>
|
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上页</a>
|
||||||
|
|
||||||
@@ -150,10 +152,23 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pager">
|
<div class="pager">
|
||||||
<a class="url_pre" id="pb_prev" href="/read/161/31043.html" style="">上页</a>
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<a id="pb_mulu" href="/shishang/161.html">书页</a>
|
<a class="url_pre" id="pb_prev" href='javascript:'>上一页</a>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
|
<a class="url_pre" id="pb_prev"
|
||||||
|
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上页</a>
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<a id="pb_mulu" href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>目录</a>
|
||||||
<a id="pb_mulu" onclick="addBookshelfFun()">存书签</a>
|
<a id="pb_mulu" onclick="addBookshelfFun()">存书签</a>
|
||||||
<a class="url_next" id="pb_next" href="/read/161/31050_1.html">下页</a>
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
|
<a class="url_next" id="pb_next"
|
||||||
|
href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下页</a>
|
||||||
|
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tui">
|
<div class="tui">
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
"url": "https://{$DomainModel->d_domain}"
|
"url": "https://{$DomainModel->d_domain}"
|
||||||
},
|
},
|
||||||
"image": "{$arrNovel.n_cover_path ?? ''}",
|
"image": "{$arrNovel.n_cover_path ?? ''}",
|
||||||
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}',
|
||||||
"inLanguage": "zh-CN",
|
"inLanguage": "zh-CN",
|
||||||
"genre": "{$arrNovel.n_category ??''}",
|
"genre": "{$arrNovel.n_category ??''}",
|
||||||
"datePublished": "{$arrNovel['n_update_time'] ?? time()}",
|
"datePublished": "{$arrNovel['n_update_time'] ?? time()}",
|
||||||
"hasPart": {
|
"hasPart": {
|
||||||
"@type": "CreativeWork",
|
"@type": "CreativeWork",
|
||||||
"name": "{$arrChapter.c_name ?? ''}",
|
"name": "{$arrChapter.c_name ?? ''}",
|
||||||
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
"url":'https://{$DomainModel->d_domain}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}',
|
||||||
"description": '{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}'
|
"description": '{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,19 +105,20 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
</div>
|
</div>
|
||||||
{$arrGrm[2]|raw}
|
{$arrGrm[2]|raw}
|
||||||
<div id="readLoadNext" class="read-load-next">
|
<div id="readLoadNext" class="read-load-next">
|
||||||
{if $arrChapter.c_sort_num == 1 }
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
{$arrGrm[3]|raw}
|
|
||||||
<a href="javascript:" class="btn-normal red" data-size="14" role="button">上一章</a>
|
<a href="javascript:" class="btn-normal red" data-size="14" role="button">上一章</a>
|
||||||
{elseif $arrChapter['pre_chapter'] && $arrChapter['pre_chapter']['c_sort_num']}
|
{/if}
|
||||||
{$arrGrm[4]|raw}
|
|
||||||
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="0"/}'
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
|
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'
|
||||||
class="btn-normal red" data-size="14" role="button">上一章</a>
|
class="btn-normal red" data-size="14" role="button">上一章</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="0"/}'
|
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'
|
||||||
class="btn-normal red" data-size="14" role="button">下一章</a>
|
class="btn-normal red" data-size="14" role="button">下一章</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<a href="#" class="btn-blank blue" style="display:none">已经是最后一章了 »</a>
|
<a href="#" class="btn-blank blue" style="display:none">已经是最后一章了 »</a>
|
||||||
</div>
|
</div>
|
||||||
<article id="chapterContent" class="read-article" style="font-size: 1.125rem">
|
<article id="chapterContent" class="read-article" style="font-size: 1.125rem">
|
||||||
@@ -128,15 +129,17 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
</article>
|
</article>
|
||||||
{$arrGrm[5]|raw}
|
{$arrGrm[5]|raw}
|
||||||
<div id="readLoadNext" class="read-load-next">
|
<div id="readLoadNext" class="read-load-next">
|
||||||
{if $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<a href="javascript:" class="btn-normal red" data-size="14" role="button">上一章</a>
|
<a href="javascript:" class="btn-normal red" data-size="14" role="button">上一章</a>
|
||||||
{elseif $arrChapter['pre_chapter'] && $arrChapter['pre_chapter']['c_sort_num']}
|
{/if}
|
||||||
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="0"/}'
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
|
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'
|
||||||
class="btn-normal red" data-size="14" role="button">上一章</a>
|
class="btn-normal red" data-size="14" role="button">上一章</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="0"/}'
|
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'
|
||||||
class="btn-normal red" data-size="14" role="button">下一章</a>
|
class="btn-normal red" data-size="14" role="button">下一章</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@@ -173,7 +176,7 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
<a href='{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
||||||
{$arrNovel.n_name}
|
{$arrNovel.n_name}
|
||||||
</a>
|
</a>
|
||||||
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}'>{$arrChapter.c_name}</a>
|
<a href='{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}'>{$arrChapter.c_name}</a>
|
||||||
|
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
@@ -377,7 +380,7 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
//下一章id
|
//下一章id
|
||||||
nextId: '{$arrNextChapter.c_sort_num ?? 1}'
|
nextId: '{$arrNextChapter.c_sort_num ?? 1}'
|
||||||
};
|
};
|
||||||
book.chapterUrl = '{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}' ;
|
book.chapterUrl = '{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}' ;
|
||||||
book.url = '{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'
|
book.url = '{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'
|
||||||
book.nextChapterVip = 0;
|
book.nextChapterVip = 0;
|
||||||
book.uid = 0;
|
book.uid = 0;
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
"url": "https://{$DomainModel->d_domain}"
|
"url": "https://{$DomainModel->d_domain}"
|
||||||
},
|
},
|
||||||
"image": "{$arrNovel.n_cover_path ?? ''}",
|
"image": "{$arrNovel.n_cover_path ?? ''}",
|
||||||
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}',
|
||||||
"inLanguage": "zh-CN",
|
"inLanguage": "zh-CN",
|
||||||
"genre": "{$arrNovel.n_category ??''}",
|
"genre": "{$arrNovel.n_category ??''}",
|
||||||
"datePublished": "{$arrNovel['n_update_time'] ?? time()}",
|
"datePublished": "{$arrNovel['n_update_time'] ?? time()}",
|
||||||
"hasPart": {
|
"hasPart": {
|
||||||
"@type": "CreativeWork",
|
"@type": "CreativeWork",
|
||||||
"name": "{$arrChapter.c_name ?? ''}",
|
"name": "{$arrChapter.c_name ?? ''}",
|
||||||
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}',
|
"url":'https://{$DomainModel->d_domain}{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}',
|
||||||
"description": '{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}'
|
"description": '{site:replace code="NOVEL@GETNOVELCHAPTER@DESCRIPTION"}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,14 +113,14 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<div class="type-box">
|
<div class="type-box">
|
||||||
<h3><a href='{$strPcPath}{site:nflurl gender="$strNanUrlTemp" category="all" status="all" page="1"/}'>男生</a></h3>
|
<h3><a href='{$strPcPath}{site:nflurl gender="$strNanUrlTemp" category="all" status="all" page="1"/}'>男生</a></h3>
|
||||||
{novel:category d_key="strCategoryPinyin" d_val="strCategoryName" n_sex="man"}
|
{novel:category d_key="strCategoryPinyin" d_val="strCategoryName" n_sex="man"}
|
||||||
<a href='{$strPcPath}{site:nflurl gender="$strNanUrlTemp" category="{$strCategoryPinyin}" status="all" page="1"/}'>{$strCategoryName}</a>
|
<a href='{$strPcPath}{site:nflurl gender="$strNanUrlTemp" category="$strCategoryPinyin" status="all" page="1"/}'>{$strCategoryName}</a>
|
||||||
{/novel:category}
|
{/novel:category}
|
||||||
</div>
|
</div>
|
||||||
<div class="type-box">
|
<div class="type-box">
|
||||||
|
|
||||||
<h3><a href='{$strPcPath}{site:nflurl gender="$strNvUrlTemp" category="all" status="all" page="1"/}'>女生</a></h3>
|
<h3><a href='{$strPcPath}{site:nflurl gender="$strNvUrlTemp" category="all" status="all" page="1"/}'>女生</a></h3>
|
||||||
{novel:category d_key="strCategoryPinyin" d_val="strCategoryName" n_sex="women"}
|
{novel:category d_key="strCategoryPinyin" d_val="strCategoryName" n_sex="women"}
|
||||||
<a href='{$strPcPath}{site:nflurl gender="$strNvUrlTemp" category="{$strCategoryPinyin}" status="all" page="1"/}'>{$strCategoryName}</a>
|
<a href='{$strPcPath}{site:nflurl gender="$strNvUrlTemp" category="$strCategoryPinyin" status="all" page="1"/}'>{$strCategoryName}</a>
|
||||||
{/novel:category}
|
{/novel:category}
|
||||||
</div>
|
</div>
|
||||||
<div class="type-box">
|
<div class="type-box">
|
||||||
@@ -197,7 +197,7 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<a href='{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
<a href='{$strPcPath}{site:nurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" /}'>
|
||||||
{$arrNovel.n_name}
|
{$arrNovel.n_name}
|
||||||
</a>
|
</a>
|
||||||
<a href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}'
|
<a href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}'
|
||||||
>{$arrChapter.c_name}</a>
|
>{$arrChapter.c_name}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="text-info cf">
|
<div class="text-info cf">
|
||||||
@@ -230,16 +230,19 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<div class="chapter-control dib-wrap">
|
<div class="chapter-control dib-wrap">
|
||||||
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
{if $arrChapter && $arrChapter.c_sort_num && $arrChapter.c_sort_num == 1}
|
||||||
<a id="j_chapterPrev" href="javascript:void(0);">上一章</a>
|
<a id="j_chapterPrev" href="javascript:void(0);">上一章</a>
|
||||||
{else}
|
{/if}
|
||||||
|
|
||||||
|
{if $arrChapter.pre_chapter && $arrChapter.pre_chapter.c_sort_num}
|
||||||
{$arrGrm[10]|raw}
|
{$arrGrm[10]|raw}
|
||||||
<a id="j_chapterPrev"
|
<a id="j_chapterPrev"
|
||||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="0"/}'>上一章</a>
|
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.pre_chapter.c_sort_num" c_page="$arrChapter.pre_chapter.c_page"/}'>上一章</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
{if $arrChapter.next_chapter && $arrChapter.next_chapter.c_sort_num}
|
||||||
{$arrGrm[9]|raw}
|
{$arrGrm[9]|raw}
|
||||||
<a id="j_chapterNext"
|
<a id="j_chapterNext"
|
||||||
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="0"/}'>下一章</a>
|
href='{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.next_chapter.c_sort_num" c_page="$arrChapter.next_chapter.c_page"/}'>下一章</a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -414,7 +417,7 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
//下一章id
|
//下一章id
|
||||||
nextId: '{$arrChapter.next_chapter.c_sort_num ?? 1}'
|
nextId: '{$arrChapter.next_chapter.c_sort_num ?? 1}'
|
||||||
};
|
};
|
||||||
book.chapterUrl = '{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="0"/}' ;
|
book.chapterUrl = '{$strPcPath}{site:cpurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" c_sort="$arrChapter.c_sort_num" c_page="$arrChapter.c_page"/}' ;
|
||||||
book.nextChapterVip = 0;
|
book.nextChapterVip = 0;
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="/template/kuangyu/reader/web/js/global.js"></script>
|
<script type="text/javascript" src="/template/kuangyu/reader/web/js/global.js"></script>
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ c_page="$Request.route.intChapterPage" c_key="arrChapter" /}
|
|||||||
<span data-v-080d7b61="" class="lh1 " style="color: #e5353e;"> 上一章</span>
|
<span data-v-080d7b61="" class="lh1 " style="color: #e5353e;"> 上一章</span>
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div data-v-080d7b61="" class="menu s-btn mulu-btn">
|
<div data-v-080d7b61="" class="menu s-btn mulu-btn">
|
||||||
<a style="color: #e5353e;"
|
<a style="color: #e5353e;"
|
||||||
href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节列表</a>
|
href='{site:nclurl n_id="$arrNovel.n_id" n_py="$arrNovel.n_name_pinyin" order="zheng" page="1"/}'>章节列表</a>
|
||||||
|
|||||||
294
code/app/home/view/xiongMao/sitemap/index.md
Normal file
294
code/app/home/view/xiongMao/sitemap/index.md
Normal file
@@ -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/`)。
|
||||||
|
- 设置高优先级(如 `<priority>1.0</priority>`)和频繁更新(如 `<changefreq>daily</changefreq>`)。
|
||||||
|
|
||||||
|
- **分类列表(主页面)**:
|
||||||
|
- 包含每个分类的主页面(如 `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`)。
|
||||||
|
- 如果排行榜页面频繁更新(如每日排行),可设置 `<changefreq>daily</changefreq>`。
|
||||||
|
- 排除次要或动态参数页面(如 `?sort=week`),避免重复内容。
|
||||||
|
|
||||||
|
- **详情页面**:
|
||||||
|
- 包含所有小说详情页面(如 `https://www.example.com/book/123`)。
|
||||||
|
- 这些页面是 SEO 的核心,吸引搜索流量(如用户搜索小说名)。
|
||||||
|
- 使用 `<lastmod>` 反映小说更新时间,提示搜索引擎重新抓取。
|
||||||
|
|
||||||
|
- **目录页面**:
|
||||||
|
- 包含每个小说的目录页面(如 `https://www.example.com/book/123/chapters`)。
|
||||||
|
- 目录页面便于用户导航,且可能被搜索引擎索引为长尾关键词(如“小说名 章节列表”)。
|
||||||
|
|
||||||
|
- **章节页面(可选)**:
|
||||||
|
- **不建议全部包含**:小说章节页面数量庞大(可能数十万到数百万),SEO 价值较低(用户很少通过搜索直接进入具体章节)。
|
||||||
|
- **可选策略**:
|
||||||
|
- 只包含最新章节(如最近 30 天的章节),吸引搜索引擎抓取更新内容。
|
||||||
|
- 只包含热门小说的前几章(如前 10 章),作为引流入口。
|
||||||
|
- 如果包含,设置较低优先级(如 `<priority>0.3</priority>`)。
|
||||||
|
|
||||||
|
#### 2. 哪些 URL 应该排除?
|
||||||
|
- **分页 URL**:如分类列表的 `?page=2`,重复内容无 SEO 价值。
|
||||||
|
- **动态参数 URL**:如 `?sort=latest` 或 `?utm_source=...`,应规范化到标准 URL。
|
||||||
|
- **不可索引页面**:
|
||||||
|
- 已设置 `<meta name="robots" content="noindex">` 的页面。
|
||||||
|
- 被 `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
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.example.com/sitemap-main.xml</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.example.com/sitemap-books.xml</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.example.com/sitemap-chapters.xml</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
</sitemapindex>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. 分组策略
|
||||||
|
- **按页面类型分组**:
|
||||||
|
- `sitemap-main.xml`:首页、分类列表、排行榜、男生/女生频道。
|
||||||
|
- `sitemap-books.xml`:小说详情页面和目录页面。
|
||||||
|
- `sitemap-chapters.xml`:章节页面(如果包含)。
|
||||||
|
- **按更新频率分组**:
|
||||||
|
- 频繁更新的页面(如排行榜、最新章节)单独分组,设置 `<changefreq>daily</changefreq>`。
|
||||||
|
- **按小说分组**:
|
||||||
|
- 为每部小说生成单独的 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. **优先级设置**:
|
||||||
|
- 首页:`<priority>1.0</priority>`
|
||||||
|
- 分类/频道/详情页:`<priority>0.8</priority>`
|
||||||
|
- 目录页:`<priority>0.6</priority>`
|
||||||
|
- 章节页(若包含):`<priority>0.3</priority>`
|
||||||
|
|
||||||
|
2. **更新频率**:
|
||||||
|
- 首页、排行榜:`<changefreq>daily</changefreq>`
|
||||||
|
- 分类/频道/详情/目录页:`<changefreq>weekly</changefreq>`
|
||||||
|
- 章节页:`<changefreq>monthly</changefreq>`(或 `never` 如果不频繁更新)
|
||||||
|
|
||||||
|
3. **规范化 URL**:
|
||||||
|
- 确保只包含规范 URL(如 `https://www.example.com/book/123` 而非 `http://example.com/book/123`)。
|
||||||
|
- 使用 `<link rel="canonical">` 或 Sitemap 统一规范版本。
|
||||||
|
|
||||||
|
4. **避免重复内容**:
|
||||||
|
- 排除带参数的 URL(如 `?sort=latest`)。
|
||||||
|
- 如果男生/女生频道与分类列表有重复内容,选择主要入口包含在 Sitemap 中。
|
||||||
|
|
||||||
|
5. **图片 Sitemap(可选)**:
|
||||||
|
- 为小说封面图片创建图片 Sitemap,优化图片搜索排名。
|
||||||
|
- 示例:
|
||||||
|
```xml
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/book/123</loc>
|
||||||
|
<image:image>
|
||||||
|
<image:loc>https://www.example.com/images/book123.jpg</image:loc>
|
||||||
|
<image:title>小说封面</image:title>
|
||||||
|
</image:image>
|
||||||
|
</url>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 六、注意事项
|
||||||
|
1. **章节页面数量庞大**:
|
||||||
|
- 如果每部小说有数百章节,章节页面可能占主导。建议只包含最新或热门章节,或完全排除章节页面,依靠目录页面引导爬虫。
|
||||||
|
2. **抓取预算**:
|
||||||
|
- 小说站点 URL 数量多,需优化 Sitemap 避免浪费搜索引擎的抓取预算。
|
||||||
|
3. **动态更新**:
|
||||||
|
- 小说站点内容更新频繁(如新章节发布),建议动态生成 Sitemap 或频繁更新。
|
||||||
|
4. **验证 Sitemap**:
|
||||||
|
- 提交 `sitemap_index.xml` 到 Google Search Console、Bing Webmaster Tools,检查是否被正确解析。
|
||||||
|
- 使用 GSC 的“索引覆盖率”报告,确认重要页面(如详情页)是否被索引。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 七、示例 Sitemap 配置
|
||||||
|
#### 索引文件(`sitemap_index.xml`)
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.example.com/sitemap-main.xml</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.example.com/sitemap-books.xml</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
</sitemapindex>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 主 Sitemap(`sitemap-main.xml`)
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/category/xuanhuan</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/male</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/rank/hot</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 小说 Sitemap(`sitemap-books.xml`)
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/book/123</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.example.com/book/123/chapters</loc>
|
||||||
|
<lastmod>2025-04-21</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.6</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 八、结论
|
||||||
|
- **不需包含所有 URL**:小说站点应优先包含首页、分类列表、男生/女生频道、排行榜、详情页面和目录页面。章节页面可根据需要部分包含或完全排除。
|
||||||
|
- **精选策略**:重点包含 SEO 价值高的页面(如详情页),排除分页、动态参数、低价值页面。
|
||||||
|
- **大型站点处理**:使用 Sitemap 索引文件和子 Sitemap,按页面类型分组,动态生成以应对大量 URL。
|
||||||
|
- **SEO 优化**:设置合理的 `<priority>` 和 `<changefreq>`,定期更新 Sitemap,验证索引效果。
|
||||||
|
|
||||||
|
如果你需要针对小说站点的具体脚本(生成 Sitemap 或伪静态配置)、CMS 插件推荐,或其他细节(如图片 Sitemap、robots.txt 优化),请告诉我!
|
||||||
3
code/app/home/view/xiongMao/sitemap/robots.txt
Normal file
3
code/app/home/view/xiongMao/sitemap/robots.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
|
Sitemap: https://{$DomainModel->d_domain}/sitemap_index.xml
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{novel:pagerexp page="$Request.get.page" limit="40000"
|
||||||
|
sort_type="news"
|
||||||
|
d_key="key"
|
||||||
|
d_val="Novel"
|
||||||
|
cache_life="86400" func="generateCategoryPager" export_name="resData" /}
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<!-- // 根据分页查询,按顺序 每页 50000个小说 -->
|
||||||
|
|
||||||
|
{foreach $resData.data as $key=>$Novel}
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}{site:nclurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" order="zheng" page="1"/}</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
{/foreach}
|
||||||
|
<!-- 最多 50,000 个 <url> 条目 -->
|
||||||
|
</urlset>
|
||||||
20
code/app/home/view/xiongMao/sitemap/sitemap-books.xml
Normal file
20
code/app/home/view/xiongMao/sitemap/sitemap-books.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{novel:pagerexp page="$Request.get.page" limit="40000"
|
||||||
|
sort_type="news"
|
||||||
|
d_key="key"
|
||||||
|
d_val="Novel"
|
||||||
|
cache_life="86400" func="generateCategoryPager" export_name="resData" /}
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<!-- // 根据分页查询,按顺序 每页 50000个小说 -->
|
||||||
|
|
||||||
|
{foreach $resData.data as $key=>$Novel}
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}{site:nurl n_id="$Novel->n_id" n_py="$Novel->n_name_pinyin"/}</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
</urlset>
|
||||||
18
code/app/home/view/xiongMao/sitemap/sitemap-chapters.xml
Normal file
18
code/app/home/view/xiongMao/sitemap/sitemap-chapters.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{novel:pagerexp page="$Request.get.page" limit="40000"
|
||||||
|
sort_type="news"
|
||||||
|
d_key="key"
|
||||||
|
d_val="Novel"
|
||||||
|
cache_life="86400" func="generateCategoryPager" export_name="resData" /}
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
{foreach $resData.data as $key=>$Novel}
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}{site:lcpurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.6</priority>
|
||||||
|
</url>
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
</urlset>
|
||||||
46
code/app/home/view/xiongMao/sitemap/sitemap-main.xml
Normal file
46
code/app/home/view/xiongMao/sitemap/sitemap-main.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}/</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<!-- 排行榜 -->
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}{$strRankUrlTemp}</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
{novel:status d_key="status_key" d_val="val"}
|
||||||
|
{novel:ranksort d_key="sot_key" d_val="val"}
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}{site:rankurl status="$status_key" order="$sot_key" page="1"/}</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
{/novel:ranksort}
|
||||||
|
{/novel:status}
|
||||||
|
|
||||||
|
<!-- 分类 -->
|
||||||
|
{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"}
|
||||||
|
<url>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}{site:nflurl category="$strCategoryPinyin" order="$sort_key" status="$status_key" /}</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
{/novel:status}
|
||||||
|
{/novel:sort}
|
||||||
|
{/novel:category}
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 注意 所有链接不要分页,有分页的取第一页即可 -->
|
||||||
|
</urlset>
|
||||||
39
code/app/home/view/xiongMao/sitemap/sitemap_index.xml
Normal file
39
code/app/home/view/xiongMao/sitemap/sitemap_index.xml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{novel:pagerexp page="1" limit="40000"
|
||||||
|
sort_type="news"
|
||||||
|
d_key="d_key"
|
||||||
|
d_val="Novel"
|
||||||
|
cache_life="86400" func="generateCategoryPager" export_name="resData" /}
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}/sitemap-main.xml</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
|
||||||
|
<!--小说总数量/50000 得出 sitemap-books 一共有多少个 -->
|
||||||
|
{for start="0" end="$resData.p_data.pages"}
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}/sitemap-books-{$i+1}.xml</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
{/for}
|
||||||
|
|
||||||
|
<!-- 小说总数量/50000 得出 sitemap-books-catalog一共有多少个,每个小说只取一个目录链接,分页不需要加入去 -->
|
||||||
|
{for start="0" end="$resData.p_data.pages"}
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}/sitemap-books-catalog-{$i+1}.xml</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
{/for}
|
||||||
|
|
||||||
|
<!-- 小说章节取最新章节 -->
|
||||||
|
{for start="0" end="$resData.p_data.pages"}
|
||||||
|
<sitemap>
|
||||||
|
<loc>https://www.{$DomainModel->d_domain}/sitemap-chapters-{$i+1}.xml</loc>
|
||||||
|
<lastmod>{:date('Y-m-d')}</lastmod>
|
||||||
|
</sitemap>
|
||||||
|
{/for}
|
||||||
|
|
||||||
|
|
||||||
|
</sitemapindex>
|
||||||
Reference in New Issue
Block a user