feat: sync latest GPT SEO routing and docs

This commit is contained in:
root
2026-04-18 01:31:44 +08:00
parent c8fb6956ef
commit 5cb11b4476
48 changed files with 6000 additions and 172 deletions

View File

@@ -7,6 +7,7 @@ use think\exception\Handle;
use think\exception\HttpException;
use think\exception\HttpResponseException;
use think\exception\ValidateException;
use think\facade\Log;
use think\Response;
use Throwable;
@@ -36,6 +37,8 @@ class ExceptionHandle extends Handle
*/
public function report(Throwable $exception): void
{
$this->reportFrontendDetailException($exception);
// 使用内置的方式记录异常日志
parent::report($exception);
}
@@ -55,4 +58,63 @@ class ExceptionHandle extends Handle
// 其他错误交给系统处理
return parent::render($request, $e);
}
protected function reportFrontendDetailException(Throwable $exception): void
{
try {
if (!function_exists('request')) {
return;
}
$request = request();
if (!$request) {
return;
}
$path = '/' . ltrim((string)$request->pathinfo(), '/');
$normalizedPath = strtolower($path);
$isDetailLike = str_starts_with($normalizedPath, '/detail/')
|| str_starts_with($normalizedPath, '/voddetail/')
|| str_starts_with($normalizedPath, '/video-detail/')
|| str_starts_with($normalizedPath, '/vodinfo/')
|| str_starts_with($normalizedPath, '/video-info/')
|| str_starts_with($normalizedPath, '/film/')
|| str_starts_with($normalizedPath, '/movie/')
|| str_starts_with($normalizedPath, '/player/')
|| str_starts_with($normalizedPath, '/vodplay/')
|| str_starts_with($normalizedPath, '/video-bofang/')
|| str_starts_with($normalizedPath, '/bf-');
if (!$isDetailLike) {
return;
}
$route = method_exists($request, 'route') ? $request->route() : null;
$routeVars = [];
foreach (['strPinyin', 'intVId', 'intVForgeId', 'strPlayType', 'intPlayIndex'] as $key) {
try {
$routeVars[$key] = $route ? $route->getRuleParam($key) : null;
} catch (Throwable) {
$routeVars[$key] = null;
}
}
Log::error('frontend_detail_exception', [
'host' => (string)$request->host(true),
'method' => (string)$request->method(),
'url' => (string)$request->url(true),
'path' => $path,
'ip' => (string)$request->ip(),
'user_agent' => (string)$request->server('HTTP_USER_AGENT', ''),
'query' => $request->get(),
'route' => $routeVars,
'exception_class' => get_class($exception),
'exception_message' => $exception->getMessage(),
'exception_file' => $exception->getFile(),
'exception_line' => $exception->getLine(),
]);
} catch (Throwable) {
// 避免异常上报链路再抛错,影响原始异常处理。
}
}
}

View File

@@ -22,37 +22,57 @@ $strTmpCode = $siteContext->getTemplate();
if ($strTmpCode == 'videoGpt1') {
// if (env('IS_GPT_TMP', false)) {
$routeGetHead = static function (string $route, $handler) {
return Route::rule($route, $handler, 'GET|HEAD');
};
// ---------- Common public routes (keep compatible) ----------
Route::get('/robots', function (\think\Request $Request, SiteContext $SiteContext) {
$routeGetHead('/robots', function (\think\Request $Request, SiteContext $SiteContext) {
return view('sitemap/robots.txt');
})->ext('txt');
Route::get('/sitemap', function (\think\Request $Request, SiteContext $SiteContext) {
$routeGetHead('/sitemap', function (\think\Request $Request, SiteContext $SiteContext) {
return view('video/getMap.html');
})->ext('html');
Route::get('rss/baidu', function () {
$routeGetHead('/sitemap.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('INDEX');
});
$routeGetHead('rss/baidu', function () {
return view('rss/baidu.xml')->contentType('text/xml');
})->ext('xml');
Route::get('rss/so', function () {
$routeGetHead('rss/so', function () {
return view('rss/so.xml')->contentType('text/xml');
})->ext('xml');
Route::get('/sitemap_index', function (\think\Request $Request, SiteContext $SiteContext) {
$routeGetHead('/sitemap_index', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('INDEX');
})->ext('xml');
Route::get('/sitemap-main', function (\think\Request $Request, SiteContext $SiteContext) {
$routeGetHead('/sitemap_index.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('INDEX');
});
$routeGetHead('/sitemap-main', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('MAIN');
})->ext('xml');
Route::get('/sitemap-videos-:page', function (\think\Request $Request, SiteContext $SiteContext) {
$routeGetHead('/sitemap-main.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('MAIN');
});
$routeGetHead('/sitemap-videos-:page', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('VIDEO');
})->ext('xml');
$routeGetHead('/sitemap-videos-:page.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('VIDEO');
});
// 榜单首页历史深链优先硬绑定,避免被通用 rank_list 模式误吞到列表页模板。
Route::get('/phb-index', function () {
$routeGetHead('/phb-index', function () {
return view('video/getRankIndex.html');
});
@@ -67,13 +87,13 @@ if ($strTmpCode == 'videoGpt1') {
string $route,
string $view,
array $pattern = []
) use (&$registered) {
) use (&$registered, $routeGetHead) {
if (isset($registered[$route])) {
return;
}
$r = Route::get($route, fn() => view($view));
$r = $routeGetHead($route, fn() => view($view));
if ($pattern) {
$r->pattern($pattern);
@@ -88,7 +108,7 @@ if ($strTmpCode == 'videoGpt1') {
if (str_ends_with($route, '.html')) {
$routeWithoutExt = substr($route, 0, -5);
if ($routeWithoutExt !== '' && !isset($registered[$routeWithoutExt])) {
$alias = Route::get($routeWithoutExt, fn() => view($view))->ext('html');
$alias = $routeGetHead($routeWithoutExt, fn() => view($view))->ext('html');
if ($pattern) {
$alias->pattern($pattern);
}
@@ -163,7 +183,7 @@ if ($strTmpCode == 'videoGpt1') {
case 'detail':
$register($route, 'video/getVideoInfo.html', [
'intVId' => '\d+',
'intVId' => '\d*',
'strPinyin' => '[\w-]+'
]);
break;
@@ -255,6 +275,9 @@ if ($strTmpCode == 'videoGpt1') {
'/shipin-neiron/:intVId-:intVForgeId',
],
'detail' => [
'/detail/:strPinyin',
'/detail/pinyin-:strPinyin',
'/detail/:strPinyin/:intVForgeId',
'/voddetail/:strPinyin-:intVId',
'/vodinfo/:strPinyin-:intVId',
'/vod/:strPinyin-:intVId',
@@ -327,8 +350,9 @@ if ($strTmpCode == 'videoGpt1') {
case 'detail':
$register($route, 'video/getVideoInfo.html', [
'intVId' => '\d+',
'intVId' => '\d*',
'strPinyin' => '[\w-]+',
'intVForgeId' => '\d*',
]);
break;
@@ -374,6 +398,10 @@ if ($strTmpCode == 'videoGpt1') {
return view('video/getMap.html');
})->ext('html');
Route::get('/sitemap.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('INDEX');
});
/**
* /rss/baidu
*/
@@ -398,6 +426,10 @@ if ($strTmpCode == 'videoGpt1') {
// return view('sitemap/sitemap_index.xml');
})->ext('xml');
Route::get('/sitemap_index.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('INDEX');
});
/**
* 首页、分类列表、排行榜、男生/女生频道。
*/
@@ -406,6 +438,10 @@ if ($strTmpCode == 'videoGpt1') {
// return view('sitemap/sitemap-main.xml');
})->ext('xml');
Route::get('/sitemap-main.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('MAIN');
});
/**
* 小说目录页面。
*/
@@ -445,6 +481,10 @@ if ($strTmpCode == 'videoGpt1') {
// return view('sitemap/sitemap-books.xml');
})->ext('xml');
Route::get('/sitemap-videos-:page.xml', function (\think\Request $Request, SiteContext $SiteContext) {
return $SiteContext->getSiteMapByCode('VIDEO');
});
/**
* 搜索首页

View File

@@ -1,117 +1,133 @@
{// ===================== Title Variants ===================== }
{php}
$strDetailTitleName = trim((string)($arrVideo['v_name'] ?? ''));
if ($strDetailTitleName === '') {
$strDetailTitleName = '视频详情';
}
$strDetailTitleYear = trim((string)($arrVideo['v_year'] ?? ''));
$boolShowDetailYear = $strDetailTitleYear !== ''
&& preg_match('/^(19|20)\d{2}$/', $strDetailTitleYear)
&& $strDetailTitleYear !== '0';
$strDetailTitleScore = trim((string)($arrVideo['v_score'] ?? ''));
$boolShowDetailScore = $strDetailTitleScore !== ''
&& is_numeric($strDetailTitleScore)
&& (float)$strDetailTitleScore > 0;
{/php}
{if $variant == 0}
<h1 class="{$TpStyle.dom_prefix}-dm-title v0">
{$arrVideo.v_name}
{$strDetailTitleName}
</h1>
{elseif $variant == 1}
<h1 class="{$TpStyle.dom_prefix}-dm-title v1">
{$arrVideo.v_name}
<small>{$arrVideo.v_year}</small>
{$strDetailTitleName}
{if $boolShowDetailYear}<small>{$strDetailTitleYear}</small>{/if}
</h1>
{elseif $variant == 2}
<h2 class="{$TpStyle.dom_prefix}-dm-title v2">
《{$arrVideo.v_name}》
</h2>
<h1 class="{$TpStyle.dom_prefix}-dm-title v2">
《{$strDetailTitleName}》
</h1>
{elseif $variant == 3}
<header class="{$TpStyle.dom_prefix}-dm-title-wrap v3">
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</h1>
<span class="{$TpStyle.dom_prefix}-dm-sub">{$arrVideo.v_year}</span>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
{if $boolShowDetailYear}<span class="{$TpStyle.dom_prefix}-dm-sub">{$strDetailTitleYear}</span>{/if}
</header>
{elseif $variant == 4}
<div class="{$TpStyle.dom_prefix}-dm-title-box v4">
<strong class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</strong>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
</div>
{elseif $variant == 5}
<h1 class="{$TpStyle.dom_prefix}-dm-title v5">
{$arrVideo.v_name}
{$strDetailTitleName}
<sup>HD</sup>
</h1>
{elseif $variant == 6}
<section class="{$TpStyle.dom_prefix}-dm-title-wrap v6">
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</h1>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
</section>
{elseif $variant == 7}
<article class="{$TpStyle.dom_prefix}-dm-title-wrap v7">
<h2 class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</h2>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
</article>
{elseif $variant == 8}
<figure class="{$TpStyle.dom_prefix}-dm-title-wrap v8">
<figcaption class="{$TpStyle.dom_prefix}-dm-title">
{$arrVideo.v_name}
</figcaption>
<h1 class="{$TpStyle.dom_prefix}-dm-title">
{$strDetailTitleName}
</h1>
</figure>
{elseif $variant == 9}
<h1 class="{$TpStyle.dom_prefix}-dm-title v9">
{$arrVideo.v_name}
<span class="{$TpStyle.dom_prefix}-dm-tag">在线观看</span>
{$strDetailTitleName}
</h1>
{elseif $variant == 10}
<h1 class="{$TpStyle.dom_prefix}-dm-title v10" data-title="{$arrVideo.v_name}">
{$arrVideo.v_name}
<h1 class="{$TpStyle.dom_prefix}-dm-title v10" data-title="{$strDetailTitleName}">
{$strDetailTitleName}
</h1>
{elseif $variant == 11}
<h2 class="{$TpStyle.dom_prefix}-dm-title v11">
<strong>{$arrVideo.v_name}</strong>
</h2>
<h1 class="{$TpStyle.dom_prefix}-dm-title v11">
<strong>{$strDetailTitleName}</strong>
</h1>
{elseif $variant == 12}
<div class="{$TpStyle.dom_prefix}-dm-title-box v12">
<h1 class="{$TpStyle.dom_prefix}-dm-title">
{$arrVideo.v_name}
<em>{$arrVideo.v_year}</em>
{$strDetailTitleName}
{if $boolShowDetailYear}<em>{$strDetailTitleYear}</em>{/if}
</h1>
</div>
{elseif $variant == 13}
<h1 class="{$TpStyle.dom_prefix}-dm-title v13">
{$arrVideo.v_name}
<span class="{$TpStyle.dom_prefix}-dm-score">{$arrVideo.v_score}</span>
{$strDetailTitleName}
{if $boolShowDetailScore}<span class="{$TpStyle.dom_prefix}-dm-score">{$strDetailTitleScore}</span>{/if}
</h1>
{elseif $variant == 14}
<header class="{$TpStyle.dom_prefix}-dm-title-wrap v14">
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</h1>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
<i class="{$TpStyle.dom_prefix}-dm-icon"></i>
</header>
{elseif $variant == 15}
<h1 class="{$TpStyle.dom_prefix}-dm-title v15">
{$arrVideo.v_name} 免费高清完整版
{$strDetailTitleName} 免费高清完整版
</h1>
{elseif $variant == 16}
<h1 class="{$TpStyle.dom_prefix}-dm-title v16" itemprop="name">
{$arrVideo.v_name}
{$strDetailTitleName}
</h1>
{elseif $variant == 17}
<div class="{$TpStyle.dom_prefix}-dm-title-box v17">
<h2 class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</h2>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
</div>
{elseif $variant == 18}
<h1 class="{$TpStyle.dom_prefix}-dm-title v18">
{$arrVideo.v_name}
{$strDetailTitleName}
<span class="{$TpStyle.dom_prefix}-dm-hidden">
{$arrVideo.v_year} 在线观看
{if $boolShowDetailYear}{$strDetailTitleYear}{/if}
</span>
</h1>
{elseif $variant == 19}
<section class="{$TpStyle.dom_prefix}-dm-title-wrap v19">
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$arrVideo.v_name}</h1>
<h1 class="{$TpStyle.dom_prefix}-dm-title">{$strDetailTitleName}</h1>
</section>
{/if}

View File

@@ -14,12 +14,13 @@
</figure>
<section class="{$TpStyle.dom_prefix}-p1-info">
<h1>{$arrVideo.v_name}</h1>
<h1>{$strPlayMainHeading}</h1>
<p class="{$TpStyle.dom_prefix}-p1-meta">
<span>{$arrVideo.v_category}</span>
<span>{$arrVideo.v_area}</span>
<span>{$arrVideo.v_year}</span>
<span>{$strPlayHeadingMeta}</span>
</p>
<p class="{$TpStyle.dom_prefix}-p1-des">

View File

@@ -13,11 +13,12 @@
{// 基本信息 }
<section class="{$TpStyle.dom_prefix}-p2-info">
<h1>{$arrVideo.v_name}</h1>
<h1>{$strPlayMainHeading}</h1>
<p class="{$TpStyle.dom_prefix}-p2-meta">
<span>{$arrVideo.v_category}</span>
<span>{$arrVideo.v_area}</span>
<span>{$arrVideo.v_year}</span>
<span>{$strPlayHeadingMeta}</span>
</p>
<p class="{$TpStyle.dom_prefix}-p2-actors">
主演:{$arrVideo.v_actor}

View File

@@ -13,9 +13,9 @@
<div id="dplayer" class="{$TpStyle.dom_prefix}-p3-dp"></div>
<div class="{$TpStyle.dom_prefix}-p3-info">
<h1>{$arrVideo.v_name}</h1>
<h1>{$strPlayMainHeading}</h1>
<p class="{$TpStyle.dom_prefix}-p3-meta">
{$arrVideo.v_category} · {$arrVideo.v_area} · {$arrVideo.v_year}
{$arrVideo.v_category} · {$arrVideo.v_area} · {$arrVideo.v_year} · {$strPlayHeadingMeta}
</p>
<p class="{$TpStyle.dom_prefix}-p3-actor">
主演:{$arrVideo.v_actor}

View File

@@ -11,8 +11,8 @@
</div>
<header class="{$TpStyle.dom_prefix}-p4-info">
<h1>{$arrVideo.v_name}</h1>
<p>{$arrVideo.v_year} · {$arrVideo.v_category} · {$arrVideo.v_area}</p>
<h1>{$strPlayMainHeading}</h1>
<p>{$arrVideo.v_year} · {$arrVideo.v_category} · {$arrVideo.v_area} · {$strPlayHeadingMeta}</p>
</header>
{// 下拉线路 }

View File

@@ -11,13 +11,13 @@
<div class="{$TpStyle.dom_prefix}-p5-left">
<img loading="lazy"
src="{site:cfg code='PUBLIC_COVER_DOMAIN' encode='false'/}{$arrVideo.v_pic}"
alt="{$arrVideo.v_name}"
alt="{$strPlayMainHeading}"
class="{$TpStyle.dom_prefix}-p5-pic">
</div>
<div class="{$TpStyle.dom_prefix}-p5-right">
<h1>{$arrVideo.v_name}</h1>
<h1>{$strPlayMainHeading}</h1>
<p class="{$TpStyle.dom_prefix}-p5-meta">
{$arrVideo.v_year} · {$arrVideo.v_category} · {$arrVideo.v_area}
{$arrVideo.v_year} · {$arrVideo.v_category} · {$arrVideo.v_area} · {$strPlayHeadingMeta}
</p>
<div id="dplayer" class="{$TpStyle.dom_prefix}-p5-dp"></div>
</div>

View File

@@ -7,6 +7,10 @@
data-preload="{$pageCfg.player.opt.preload|default='metadata'}"
data-ratio="{$pageCfg.player.opt.ratio|default='16x9'}">
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$strPlayMainHeading|default=$arrVideo.v_name|default='正在播放'}
</h1>
{if $variant == 0}
<div class="{$TpStyle.dom_prefix}-player-core dplayer"></div>
@@ -17,7 +21,7 @@
{elseif $variant == 2}
<header class="{$TpStyle.dom_prefix}-player-head">
<h2 class="{$TpStyle.dom_prefix}-player-title">{$arrVideo.v_name|default='正在播放'}</h2>
<h2 class="{$TpStyle.dom_prefix}-player-title">{$strPlayMainHeading|default=$arrVideo.v_name|default='正在播放'}</h2>
</header>
<div class="{$TpStyle.dom_prefix}-player-core dplayer"></div>
@@ -30,7 +34,7 @@
{elseif $variant == 4}
<article class="{$TpStyle.dom_prefix}-player-article">
<header class="{$TpStyle.dom_prefix}-player-head">
<h1 class="{$TpStyle.dom_prefix}-player-title">{$arrVideo.v_name|default='正在播放'}</h1>
<h2 class="{$TpStyle.dom_prefix}-player-title">{$strPlayMainHeading|default=$arrVideo.v_name|default='正在播放'}</h2>
</header>
<div class="{$TpStyle.dom_prefix}-player-core dplayer"></div>
</article>
@@ -38,7 +42,7 @@
{elseif $variant == 5}
<figure class="{$TpStyle.dom_prefix}-player-figure">
<div class="{$TpStyle.dom_prefix}-player-core dplayer"></div>
<figcaption class="{$TpStyle.dom_prefix}-player-caption">{$arrVideo.v_name|default='正在播放'}</figcaption>
<figcaption class="{$TpStyle.dom_prefix}-player-caption">{$strPlayMainHeading|default=$arrVideo.v_name|default='正在播放'}</figcaption>
</figure>
{elseif $variant == 6}
@@ -111,7 +115,7 @@
{elseif $variant == 18}
<header class="{$TpStyle.dom_prefix}-player-head">
<h3 class="{$TpStyle.dom_prefix}-player-title">{$arrVideo.v_name|default='正在播放'}</h3>
<h2 class="{$TpStyle.dom_prefix}-player-title">{$strPlayMainHeading|default=$arrVideo.v_name|default='正在播放'}</h2>
</header>
<main class="{$TpStyle.dom_prefix}-player-body">
<div class="{$TpStyle.dom_prefix}-player-core dplayer"></div>
@@ -123,7 +127,7 @@
{else}
<article class="{$TpStyle.dom_prefix}-player-article">
<header class="{$TpStyle.dom_prefix}-player-head">
<h2 class="{$TpStyle.dom_prefix}-player-title">{$arrVideo.v_name|default='正在播放'}</h2>
<h2 class="{$TpStyle.dom_prefix}-player-title">{$strPlayMainHeading|default=$arrVideo.v_name|default='正在播放'}</h2>
</header>
<div class="{$TpStyle.dom_prefix}-player-wrap">
<div class="{$TpStyle.dom_prefix}-player-core dplayer"></div>
@@ -134,4 +138,4 @@
</article>
{/if}
</section>
</section>

View File

@@ -2,7 +2,7 @@
{case value="0"}
<header class='__PFX__-sh-c0'>
<div class='wrap'>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>搜索结果</p>
</div>
</header>
@@ -11,21 +11,21 @@
<section class='__PFX__-sh-c1'>
<div class='center'>
<h2>Search</h2>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark> 搜索结果</h1>
</div>
</section>
{/case}
{case value="2"}
<div class='__PFX__-sh-c2'>
<div class='center'>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong></h1><small>Results</small>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong> 搜索结果</h1><small>Results</small>
</div>
</div>
{/case}
{case value="3"}
<header class='__PFX__-sh-c3'>
<div class='center'>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em> 搜索结果</h1>
</div>
<div class='underline' aria-hidden='true'></div>
</header>
@@ -34,14 +34,14 @@
<section class='__PFX__-sh-c4'>
<div class='center'>
<p class='kicker'>关键词</p>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span> 搜索结果</h1>
</div>
</section>
{/case}
{case value="5"}
<header class='__PFX__-sh-c5'>
<div class='center'>
<h1>搜索:<span class='__PFX__-k is-pill'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span> 搜索结果</h1>
<p class='sub'>为你呈现匹配内容</p>
</div>
</header>
@@ -49,7 +49,7 @@
{case value="6"}
<section class='__PFX__-sh-c6'>
<div class='center'>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark> 搜索结果</h1>
<div class='dots' aria-hidden='true'><span></span><span></span><span></span></div>
</div>
</section>
@@ -58,14 +58,14 @@
<header class='__PFX__-sh-c7'>
<div class='center'>
<nav aria-label='breadcrumb'><span>搜索</span></nav>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong> 搜索结果</h1>
</div>
</header>
{/case}
{case value="8"}
<section class='__PFX__-sh-c8'>
<div class='center card'>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>搜索结果页</p>
</div>
</section>
@@ -73,7 +73,7 @@
{case value="9"}
<div class='__PFX__-sh-c9'>
<div class='center'>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span> 搜索结果</h1>
<p class='sub'>精选匹配条目</p><a class='btn' href='javascript:void(0)' rel='nofollow'>换词</a>
</div>
</div>
@@ -82,14 +82,14 @@
<header class='__PFX__-sh-c10'>
<div class='center'>
<h2>站内检索</h2>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span> 搜索结果</h1>
</div>
</header>
{/case}
{case value="11"}
<section class='__PFX__-sh-c11'>
<div class='center'>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p class='sub'>相关搜索结果</p>
</div><svg class='sig' aria-hidden='true'></svg>
</section>
@@ -97,7 +97,7 @@
{case value="12"}
<header class='__PFX__-sh-c12'>
<div class='center'>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong> 搜索结果</h1>
<p class='sub'>结果列表</p>
</div>
<div class='frame' aria-hidden='true'></div>
@@ -106,7 +106,7 @@
{case value="13"}
<section class='__PFX__-sh-c13'>
<div class='center'>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em> 搜索结果</h1>
<p class='meta'>Search Result Page</p>
</div>
</section>
@@ -114,7 +114,7 @@
{case value="14"}
<header class='__PFX__-sh-c14'>
<div class='center'>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span> 搜索结果</h1>
<ul class='tabs'>
<li>全部</li>
<li>相关</li>
@@ -125,7 +125,7 @@
{case value="15"}
<section class='__PFX__-sh-c15'>
<div class='center'>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill'>{$Request.get.keyword}</span> 搜索结果</h1>
<details open>
<summary>展开提示</summary>
<p>结果展示</p>
@@ -136,7 +136,7 @@
{case value="16"}
<header class='__PFX__-sh-c16'>
<div class='center'>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-pill'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p class='sub'>按相关度排序</p>
</div>
</header>
@@ -144,7 +144,7 @@
{case value="17"}
<div class='__PFX__-sh-c17' role='banner'>
<div class='center'>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-pill'>{$Request.get.keyword}</strong> 搜索结果</h1>
<p class='sub'>即时匹配</p>
</div>
</div>
@@ -152,7 +152,7 @@
{case value="18"}
<section class='__PFX__-sh-c18'>
<div class='center'>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-pill'>{$Request.get.keyword}</em> 搜索结果</h1>
<p class='sub'>搜索结果</p>
<div class='pillrow'><span>搜索</span><span>结果</span></div>
</div>
@@ -161,9 +161,9 @@
{case value="19"}
<header class='__PFX__-sh-c19'>
<div class='center'>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-pill' aria-label='keyword'>{$Request.get.keyword}</span> 搜索结果</h1>
</div>
<p class='sub center'>结果页</p>
</header>
{/case}
{/switch}
{/switch}

View File

@@ -1,6 +1,9 @@
{switch $variant}
{case value="0"}
<section class='__PFX__-sh-m0'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption>🔍 <span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
@@ -8,6 +11,9 @@
{/case}
{case value="1"}
<section class='__PFX__-sh-m1'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<div class='media'></div>
<figcaption><mark class='__PFX__-k is-accent'>{$Request.get.keyword}</mark> · 搜索结果</figcaption>
@@ -16,6 +22,9 @@
{/case}
{case value="2"}
<div class='__PFX__-sh-m2'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='ico' aria-hidden='true'></span><strong
class='__PFX__-k is-accent'>{$Request.get.keyword}</strong></figcaption>
@@ -25,6 +34,9 @@
{/case}
{case value="3"}
<section class='__PFX__-sh-m3'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption>Search: <em class='__PFX__-k is-accent'>{$Request.get.keyword}</em></figcaption><small>Results</small>
</figure>
@@ -32,6 +44,9 @@
{/case}
{case value="4"}
<div class='__PFX__-sh-m4'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
@@ -40,6 +55,9 @@
{/case}
{case value="5"}
<section class='__PFX__-sh-m5'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
@@ -48,6 +66,9 @@
{/case}
{case value="6"}
<div class='__PFX__-sh-m6'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><mark class='__PFX__-k is-accent'>{$Request.get.keyword}</mark></figcaption>
<p class='sub'>搜索结果页</p>
@@ -56,6 +77,9 @@
{/case}
{case value="7"}
<section class='__PFX__-sh-m7'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><strong class='__PFX__-k is-accent'>{$Request.get.keyword}</strong></figcaption>
</figure>
@@ -64,6 +88,9 @@
{/case}
{case value="8"}
<div class='__PFX__-sh-m8'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='tag'>TAG</span><em class='__PFX__-k is-accent'>{$Request.get.keyword}</em></figcaption>
</figure>
@@ -71,6 +98,9 @@
{/case}
{case value="9"}
<section class='__PFX__-sh-m9'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
<div class='stroke' aria-hidden='true'></div>
@@ -79,6 +109,9 @@
{/case}
{case value="10"}
<div class='__PFX__-sh-m10'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
@@ -90,6 +123,9 @@
{/case}
{case value="11"}
<section class='__PFX__-sh-m11'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><mark class='__PFX__-k is-accent'>{$Request.get.keyword}</mark></figcaption>
</figure>
@@ -101,6 +137,9 @@
{/case}
{case value="12"}
<div class='__PFX__-sh-m12'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><strong class='__PFX__-k is-accent'>{$Request.get.keyword}</strong></figcaption>
</figure>
@@ -109,6 +148,9 @@
{/case}
{case value="13"}
<section class='__PFX__-sh-m13'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><em class='__PFX__-k is-accent'>{$Request.get.keyword}</em></figcaption>
</figure>
@@ -117,6 +159,9 @@
{/case}
{case value="14"}
<div class='__PFX__-sh-m14'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption>🔎 <span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
@@ -125,6 +170,9 @@
{/case}
{case value="15"}
<section class='__PFX__-sh-m15'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
@@ -133,6 +181,9 @@
{/case}
{case value="16"}
<div class='__PFX__-sh-m16'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><mark class='__PFX__-k is-accent'>{$Request.get.keyword}</mark></figcaption>
</figure>
@@ -142,6 +193,9 @@
{/case}
{case value="17"}
<section class='__PFX__-sh-m17'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><strong class='__PFX__-k is-accent'>{$Request.get.keyword}</strong></figcaption>
</figure>
@@ -150,6 +204,9 @@
{/case}
{case value="18"}
<div class='__PFX__-sh-m18'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><em class='__PFX__-k is-accent'>{$Request.get.keyword}</em></figcaption>
</figure>
@@ -158,10 +215,13 @@
{/case}
{case value="19"}
<section class='__PFX__-sh-m19'>
<h1 style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">
{$Request.get.keyword} 搜索结果
</h1>
<figure>
<figcaption><span class='__PFX__-k is-accent'>{$Request.get.keyword}</span></figcaption>
</figure>
<footer><small>search header</small></footer>
</section>
{/case}
{/switch}
{/switch}

View File

@@ -2,7 +2,7 @@
{case value="0"}
<article class='__PFX__-sh-r0'>
<header>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>与你查询相关的内容合集</p>
</header>
<aside>关键词:<mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark></aside>
@@ -12,7 +12,7 @@
<article class='__PFX__-sh-r1'>
<header>
<h2>搜索结果</h2>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span> 搜索结果</h1>
</header>
<section class='meta'><span>匹配</span><span>整理</span></section>
</article>
@@ -20,7 +20,7 @@
{case value="2"}
<main class='__PFX__-sh-r2'>
<section class='hero'>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong> 搜索结果</h1>
<p>为你推荐相关内容</p>
</section>
<section class='info'>
@@ -34,7 +34,7 @@
{case value="3"}
<article class='__PFX__-sh-r3'>
<header>
<h1>搜索:<em class='__PFX__-k is-tag'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-tag'>{$Request.get.keyword}</em> 搜索结果</h1>
</header>
<section class='cards'>
<div class='card'>相关</div>
@@ -45,7 +45,7 @@
{case value="4"}
<main class='__PFX__-sh-r4'>
<header>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code></h1>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code> 搜索结果</h1>
<p>结果列表</p>
</header>
<aside class='note'><strong>提示</strong>:尝试更具体的词</aside>
@@ -54,7 +54,7 @@
{case value="5"}
<article class='__PFX__-sh-r5'>
<header>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>按热度聚合的搜索内容</p>
</header>
<footer>来源:站内检索</footer>
@@ -64,7 +64,7 @@
<main class='__PFX__-sh-r6'>
<header>
<h2>关键词</h2>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span> 搜索结果</h1>
</header>
<section class='kv'><span>类型</span><span>内容</span></section>
</main>
@@ -72,7 +72,7 @@
{case value="7"}
<article class='__PFX__-sh-r7'>
<header>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong> 搜索结果</h1>
</header>
<section class='grid'>
<div>摘要</div>
@@ -93,7 +93,7 @@
{case value="9"}
<article class='__PFX__-sh-r9'>
<header>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code></h1>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code> 搜索结果</h1>
<p>相关内容已按主题整理</p>
</header>
<section class='list'>
@@ -107,7 +107,7 @@
{case value="10"}
<main class='__PFX__-sh-r10'>
<header>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark> 搜索结果</h1>
</header>
<section class='stat'><span class='label'>匹配</span><span class='value'>N</span></section>
</main>
@@ -115,7 +115,7 @@
{case value="11"}
<article class='__PFX__-sh-r11'>
<header>
<h1>搜索结果</h1>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span> 搜索结果</h1>
</header>
<section>
<p>关键词:<span class='__PFX__-k is-tag'>{$Request.get.keyword}</span></p>
@@ -128,7 +128,7 @@
{case value="12"}
<main class='__PFX__-sh-r12'>
<section class='banner'>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong> 搜索结果</h1>
<p>搜索结果展示页</p>
</section>
<section class='meta'><span>更新</span><span>相关</span></section>
@@ -137,7 +137,7 @@
{case value="13"}
<article class='__PFX__-sh-r13'>
<header>
<h1><em class='__PFX__-k is-tag'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-tag'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>你可能还想找:</p>
</header>
<nav class='sugs' aria-label='suggest'><a href='javascript:void(0)' rel='nofollow'>相近词</a></nav>
@@ -146,7 +146,7 @@
{case value="14"}
<main class='__PFX__-sh-r14'>
<header>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code></h1>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code> 搜索结果</h1>
</header>
<section class='panel'>
<div class='hd'>概览</div>
@@ -157,7 +157,7 @@
{case value="15"}
<article class='__PFX__-sh-r15'>
<header>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k is-tag'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>结果已按相关度排序</p>
</header>
<section class='filters'><span>全部</span><span>最新</span><span>推荐</span></section>
@@ -166,7 +166,7 @@
{case value="16"}
<main class='__PFX__-sh-r16'>
<header>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k is-tag'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>站内搜索</p>
</header>
<section class='steps'><span>1 查询</span><span>2 匹配</span><span>3 展示</span></section>
@@ -175,7 +175,7 @@
{case value="17"}
<article class='__PFX__-sh-r17'>
<header>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong></h1>
<h1><strong class='__PFX__-k is-tag'>{$Request.get.keyword}</strong> 搜索结果</h1>
</header>
<section class='qa'>
<details open>
@@ -188,7 +188,7 @@
{case value="18"}
<main class='__PFX__-sh-r18'>
<header>
<h1><em class='__PFX__-k is-tag'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k is-tag'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>聚合页</p>
</header>
<section class='table'>
@@ -204,10 +204,10 @@
{case value="19"}
<article class='__PFX__-sh-r19'>
<header>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code></h1>
<h1><code class='__PFX__-k is-tag'>{$Request.get.keyword}</code> 搜索结果</h1>
<p>内容合集</p>
</header>
<footer><small>Search Hub</small></footer>
</article>
{/case}
{/switch}
{/switch}

View File

@@ -7,51 +7,50 @@
{/case}
{case value="1"}
<section class='__PFX__-sh-e1'>
<h1>搜索:<span class='__PFX__-k'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>结果列表</p>
<link rel='canonical' href='/' />
</section>
{/case}
{case value="2"}
<div class='__PFX__-sh-e2' role='region' aria-label='search-head'>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>搜索结果页</p>
</div>
{/case}
{case value="3"}
<header class='__PFX__-sh-e3'>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1>
<p>站内搜索结果</p>
</header>
{/case}
{case value="4"}
<section class='__PFX__-sh-e4'>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 相关内容</h1>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>搜索结果</p>
</section>
{/case}
{case value="5"}
<div class='__PFX__-sh-e5'>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b></h1>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b> 搜索结果</h1>
<p>搜索结果列表页</p>
</div>
{/case}
{case value="6"}
<section class='__PFX__-sh-e6'>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>结果页SEO</p>
<hr />
</section>
{/case}
{case value="7"}
<div class='__PFX__-sh-e7'>
<h1>关键词:<em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>搜索结果</p>
</div>
{/case}
{case value="8"}
<section class='__PFX__-sh-e8'>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1>
<p>索引列表页</p>
<nav aria-label='meta'><span>Search</span></nav>
</section>
@@ -64,27 +63,25 @@
{/case}
{case value="10"}
<header class='__PFX__-sh-e10'>
<h1>搜索结果</h1>
<p><b class='__PFX__-k'>{$Request.get.keyword}</b></p>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b> 搜索结果</h1>
</header>
{/case}
{case value="11"}
<section class='__PFX__-sh-e11'>
<h1>查询词</h1>
<p><span class='__PFX__-k'>{$Request.get.keyword}</span></p>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>结果页</p>
</section>
{/case}
{case value="12"}
<div class='__PFX__-sh-e12'>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>聚合结果页</p>
<p class='micro'>可抓取</p>
</div>
{/case}
{case value="13"}
<section class='__PFX__-sh-e13'>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1>
<p>搜索结果目录</p>
<dl>
<dt>关键词</dt>
@@ -94,7 +91,7 @@
{/case}
{case value="14"}
<div class='__PFX__-sh-e14'>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>结果页</p>
<ul>
<li>相关</li>
@@ -104,20 +101,20 @@
{/case}
{case value="15"}
<header class='__PFX__-sh-e15'>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b></h1>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b> 搜索结果</h1>
<p>搜索结果索引</p>
<address>站内</address>
</header>
{/case}
{case value="16"}
<section class='__PFX__-sh-e16'>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>Search result page</p>
</section>
{/case}
{case value="17"}
<div class='__PFX__-sh-e17'>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>结果列表页</p>
<details open>
<summary>说明</summary>
@@ -127,17 +124,17 @@
{/case}
{case value="18"}
<section class='__PFX__-sh-e18'>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1>
<p>站内搜索</p>
<p class='micro'>list</p>
</section>
{/case}
{case value="19"}
<div class='__PFX__-sh-e19'>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>搜索结果</p>
<hr />
<p class='micro'>indexable</p>
</div>
{/case}
{/switch}
{/switch}

View File

@@ -1,13 +1,12 @@
{switch $variant}
{case value="0"}
<section class='__PFX__-sh-s0'>
<h1>搜索:<em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
</section>
{/case}
{case value="1"}
<aside class='__PFX__-sh-s1'>
<h2>搜索结果</h2>
<p><mark class='__PFX__-k'>{$Request.get.keyword}</mark></p>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 搜索结果</h1>
</aside>
{/case}
{case value="2"}
@@ -18,24 +17,23 @@
{/case}
{case value="3"}
<div class='__PFX__-sh-s3' role='region' aria-label='search'>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1><small>结果页</small>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1><small>结果页</small>
</div>
{/case}
{case value="4"}
<footer class='__PFX__-sh-s4'>
<h1>关键词</h1>
<p><span class='__PFX__-k'>{$Request.get.keyword}</span></p>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
</footer>
{/case}
{case value="5"}
<section class='__PFX__-sh-s5'>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>相关条目如下</p>
</section>
{/case}
{case value="6"}
<div class='__PFX__-sh-s6'>
<h1>查询</h1>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 搜索结果</h1>
<ul>
<li><mark class='__PFX__-k'>{$Request.get.keyword}</mark></li>
</ul>
@@ -43,49 +41,47 @@
{/case}
{case value="7"}
<section class='__PFX__-sh-s7'>
<h1>搜索结果:</h1>
<div><b class='__PFX__-k'>{$Request.get.keyword}</b></div>
<h1>搜索结果:<b class='__PFX__-k'>{$Request.get.keyword}</b></h1>
</section>
{/case}
{case value="8"}
<header class='__PFX__-sh-s8'>
<p class='lead'>Search</p>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1>
</header>
{/case}
{case value="9"}
<section class='__PFX__-sh-s9'>
<h1>结果:<span class='__PFX__-k'>{$Request.get.keyword}</span></h1>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<p class='tip'>可尝试同义词</p>
</section>
{/case}
{case value="10"}
<div class='__PFX__-sh-s10'>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<p>搜索结果列表</p>
<hr />
</div>
{/case}
{case value="11"}
<section class='__PFX__-sh-s11'>
<h1>站内搜索</h1>
<p>关键词:<mark class='__PFX__-k'>{$Request.get.keyword}</mark></p>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 站内搜索结果</h1>
</section>
{/case}
{case value="12"}
<aside class='__PFX__-sh-s12'>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b></h1>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b> 搜索结果</h1>
<blockquote>匹配到的内容</blockquote>
</aside>
{/case}
{case value="13"}
<section class='__PFX__-sh-s13'>
<h1>关于 <i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1>关于 <i class='__PFX__-k'>{$Request.get.keyword}</i> 的搜索结果</h1>
</section>
{/case}
{case value="14"}
<div class='__PFX__-sh-s14'>
<h1>搜索</h1>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<dl>
<dt>关键词</dt>
<dd><span class='__PFX__-k'>{$Request.get.keyword}</span></dd>
@@ -94,34 +90,33 @@
{/case}
{case value="15"}
<header class='__PFX__-sh-s15'>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em></h1>
<h1><em class='__PFX__-k'>{$Request.get.keyword}</em> 搜索结果</h1>
<nav aria-label='meta'><a href='/' rel='nofollow'>首页</a></nav>
</header>
{/case}
{case value="16"}
<section class='__PFX__-sh-s16'>
<h1>检索:<mark class='__PFX__-k'>{$Request.get.keyword}</mark></h1>
<h1><mark class='__PFX__-k'>{$Request.get.keyword}</mark> 搜索结果</h1>
<p>为你整理相关内容</p>
</section>
{/case}
{case value="17"}
<div class='__PFX__-sh-s17'>
<h2>搜索</h2>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b></h1>
<h1><b class='__PFX__-k'>{$Request.get.keyword}</b> 搜索结果</h1>
</div>
{/case}
{case value="18"}
<section class='__PFX__-sh-s18'>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i></h1>
<h1><i class='__PFX__-k'>{$Request.get.keyword}</i> 搜索结果</h1>
<p>结果页</p>
<div class='bar'></div>
</section>
{/case}
{case value="19"}
<aside class='__PFX__-sh-s19'>
<h1>查询词</h1>
<p><span class='__PFX__-k'>{$Request.get.keyword}</span></p>
<h1><span class='__PFX__-k'>{$Request.get.keyword}</span> 搜索结果</h1>
<p>搜索结果</p>
</aside>
{/case}
{/switch}
{/switch}

View File

@@ -50,6 +50,19 @@
$strCurrentEpisodeName = trim((string)$arrPlayGroups[$strCurrentPlayType][$intCurrentPlayIndex - 1]['name']);
}
$strPlayMainHeading = trim((string)($arrVideo['v_name'] ?? ''));
if ($strPlayMainHeading === '') {
$strPlayMainHeading = '当前内容';
}
if ($strCurrentEpisodeName !== '') {
$strPlayMainHeading .= ' ' . $strCurrentEpisodeName;
}
$strPlayHeadingMeta = trim($strCurrentPlayLine);
if ($strPlayHeadingMeta === '') {
$strPlayHeadingMeta = '在线播放';
}
$strPlayDetailUrl = '';
if ((int)($arrVideo['v_id'] ?? 0) > 0) {
$strPlayDetailUrl = app(\app\services\VideoService::class)->getVideoInfoUrl(

View File

@@ -99,11 +99,7 @@ class SiteContext
*/
public function getViewConfig(): array
{
$strDomain = $this->Request->rootDomain();
$this->DomainModel = DomainModel::getDomainOnCacheByDomain($strDomain);
$this->DomainModel = $this->resolveCurrentDomainModel();
if (empty($this->DomainModel)) {
throw new HttpException(404, 'Site config not Found');
@@ -1159,8 +1155,7 @@ class SiteContext
public function getTemplate(): string
{
$strDomain = $this->Request->rootDomain();
$this->DomainModel = DomainModel::getDomainOnCacheByDomain($strDomain);
$this->DomainModel = $this->resolveCurrentDomainModel();
if (empty($this->DomainModel)) {
throw new HttpException(404, 'Site config not Found');
@@ -1173,6 +1168,19 @@ class SiteContext
return $this->TemplatesModel['t_code'];
}
protected function resolveCurrentDomainModel(): ?DomainModel
{
$strHost = (string)$this->Request->host();
$arrResolvedDomain = DomainModel::resolveDomainContextByHost($strHost);
$RuntimeDomainModel = $arrResolvedDomain['runtime'] ?? null;
if ($RuntimeDomainModel instanceof DomainModel) {
return $RuntimeDomainModel;
}
$strDomain = (string)$this->Request->rootDomain();
return DomainModel::getDomainOnCacheByDomain($strDomain);
}
public function getPinlunData(int $intVideoId): array
{
$strDomain = $this->DomainModel->d_domain ?? request()->domain();

View File

@@ -887,13 +887,21 @@ class VideoService
$intVId = (int)$intVId;
$intVForgeId = $intVForgeId === null ? -1 : (int)$intVForgeId;
$strPinyin = trim((string)$strPinyin);
$boolRequirePlayable = (string)request()->route('strPlayType') !== '' || (int)request()->route('intPlayIndex') > 0;
if ($intVId > 0) {
return $this->getVideoByVId($intVId, $intVForgeId);
}
if ($strPinyin !== '') {
$arrVideo = $this->VideoModel->getVideoByNameEn($strPinyin);
foreach ($this->normalizeRouteSlugCandidates($strPinyin) as $strSlugCandidate) {
$arrVideo = $this->VideoModel->getVideoByNameEn($strSlugCandidate);
if (!empty($arrVideo)) {
return $this->hydrateResolvedVideo($arrVideo, (int)($arrVideo['v_id'] ?? 0), $intVForgeId);
}
}
$arrVideo = $this->resolveFallbackVideoBySlug($strPinyin, $boolRequirePlayable);
if (!empty($arrVideo)) {
return $this->hydrateResolvedVideo($arrVideo, (int)($arrVideo['v_id'] ?? 0), $intVForgeId);
}
@@ -902,11 +910,81 @@ class VideoService
return $this->getVideoByVId($intVId, $intVForgeId);
}
protected function normalizeRouteSlugCandidates(string $strPinyin): array
{
$strPinyin = strtolower(trim($strPinyin));
if ($strPinyin === '') {
return [];
}
$arrCandidates = [$strPinyin];
if (str_starts_with($strPinyin, 'pinyin-')) {
$arrCandidates[] = substr($strPinyin, 7);
}
$arrNormalized = [];
foreach ($arrCandidates as $candidate) {
$candidate = trim((string)$candidate, "- \t\n\r\0\x0B");
if ($candidate === '') {
continue;
}
$arrNormalized[$candidate] = $candidate;
}
return array_values($arrNormalized);
}
protected function resolveFallbackVideoBySlug(string $requestedSlug, bool $requirePlayable = false): ?array
{
$arrCandidates = $this->normalizeRouteSlugCandidates($requestedSlug);
if (empty($arrCandidates)) {
return null;
}
$strHost = (string)($this->SiteContext->DomainModel->d_domain ?? 'default');
$arrBindings = $this->readFallbackBindings($strHost);
foreach ($arrCandidates as $strSlugCandidate) {
$strBindingKey = 'slug:' . $strSlugCandidate;
$boundVId = (int)($arrBindings[$strBindingKey] ?? 0);
if ($boundVId > 0) {
$arrVideo = $this->VideoModel->getVideoByVId($boundVId);
if (!empty($arrVideo) && (!$requirePlayable || $this->hasPlayableSource($arrVideo))) {
$arrVideo['_fallback_reason'] = 'bound_slug_video';
$arrVideo['_requested_slug'] = $requestedSlug;
return $arrVideo;
}
}
}
$arrVideo = $this->resolveFallbackVideoByRequest(0, $requirePlayable);
if (empty($arrVideo)) {
return null;
}
$intResolvedVId = (int)($arrVideo['v_id'] ?? 0);
if ($intResolvedVId <= 0) {
return null;
}
foreach ($arrCandidates as $strSlugCandidate) {
$arrBindings['slug:' . $strSlugCandidate] = $intResolvedVId;
}
$this->writeFallbackBindings($strHost, $arrBindings);
$arrVideo['_fallback_reason'] = 'random_slug_video';
$arrVideo['_requested_slug'] = $requestedSlug;
return $arrVideo;
}
protected function resolveFallbackVideoByRequest(int $requestedVId, bool $requirePlayable = false): ?array
{
$strHost = (string)($this->SiteContext->DomainModel->d_domain ?? 'default');
$arrBindings = $this->readFallbackBindings($strHost);
$strBindingKey = (string)$requestedVId;
$boolPersistBinding = $requestedVId > 0;
$strBindingKey = $boolPersistBinding ? (string)$requestedVId : '';
$this->debugFallbackProbe('enter_resolve_fallback', [
'requested_v_id' => $requestedVId,
@@ -915,7 +993,7 @@ class VideoService
'existing_bindings' => count($arrBindings),
]);
$boundVId = (int)($arrBindings[$strBindingKey] ?? 0);
$boundVId = $boolPersistBinding ? (int)($arrBindings[$strBindingKey] ?? 0) : 0;
if ($boundVId > 0 && $boundVId !== $requestedVId) {
$arrVideo = $this->VideoModel->getVideoByVId($boundVId);
if (!empty($arrVideo) && (!$requirePlayable || $this->hasPlayableSource($arrVideo))) {
@@ -964,8 +1042,10 @@ class VideoService
continue;
}
$arrBindings[$strBindingKey] = $candidateId;
$this->writeFallbackBindings($strHost, $arrBindings);
if ($boolPersistBinding) {
$arrBindings[$strBindingKey] = $candidateId;
$this->writeFallbackBindings($strHost, $arrBindings);
}
$this->debugFallbackProbe('sample_success', [
'requested_v_id' => $requestedVId,
'candidate_v_id' => $candidateId,
@@ -982,8 +1062,10 @@ class VideoService
if (!empty($arrVideo)) {
$candidateId = (int)($arrVideo['v_id'] ?? 0);
if ($candidateId > 0 && $candidateId !== $requestedVId) {
$arrBindings[$strBindingKey] = $candidateId;
$this->writeFallbackBindings($strHost, $arrBindings);
if ($boolPersistBinding) {
$arrBindings[$strBindingKey] = $candidateId;
$this->writeFallbackBindings($strHost, $arrBindings);
}
$this->debugFallbackProbe('ordered_fallback_success', [
'requested_v_id' => $requestedVId,
'candidate_v_id' => $candidateId,

View File

@@ -111,7 +111,7 @@ class SiteMapLogic
$strDomainDir = $this->strSiteMapPath . $DomainModel->d_domain;
if (is_dir($strDomainDir) == false) {
mkdir($strDomainDir);
mkdir($strDomainDir, 0777, true);
}
$strHead = <<<EOF
@@ -262,7 +262,7 @@ EOF;
$strDomainDir = $this->strSiteMapPath . $DomainModel->d_domain;
if (is_dir($strDomainDir) == false) {
mkdir($strDomainDir);
mkdir($strDomainDir, 0777, true);
}
$strMapIndexFile = $strDomainDir . '/sitemap-main.xml';

View File

@@ -127,6 +127,25 @@ class VideoSiteMapLogic
echo date('Y-m-d H:i:s') . PHP_EOL;
}
protected function normalizeVideoSlug($Video): string
{
$strSlug = trim((string)($Video->v_name_en ?? ''));
if ($strSlug !== '') {
return $strSlug;
}
$strName = trim((string)($Video->v_name ?? ''));
if ($strName === '') {
return 'video';
}
$strSlug = mb_strtolower($strName, 'UTF-8');
$strSlug = preg_replace('/[^\\p{L}\\p{N}]+/u', '-', $strSlug);
$strSlug = trim((string)$strSlug, '-');
return $strSlug !== '' ? $strSlug : 'video';
}
/**
* Generate Site Map
*
@@ -140,7 +159,7 @@ class VideoSiteMapLogic
$strDomainDir = $this->strSiteMapPath . $DomainModel->d_domain;
if (is_dir($strDomainDir) == false) {
mkdir($strDomainDir);
mkdir($strDomainDir, 0777, true);
}
// 通过域名获取对应的模板
@@ -181,6 +200,7 @@ EOF;
# 取 intpage * limit ~ intpage * (limit+1) 写入以上文件
foreach ($this->fetchVideosByBatch($intStart, $this->intPageSize) as $Video) {
$strSlug = $this->normalizeVideoSlug($Video);
# 1 '/voddetail/{strPinYin}-{intVId}',
$strKey = "VIDEO_INFO_URL";
@@ -189,8 +209,8 @@ EOF;
$strAction = "";
$arrArgs = [
'intVId' => $Video->v_id,
'strPinYin' => '',
'strPinyin' => '',
'strPinYin' => $strSlug,
'strPinyin' => $strSlug,
];
if ($arrUrlFamily && !empty($arrUrlFamily)) {
@@ -272,7 +292,7 @@ $arrUrlPool = [];
$strDomainDir = $this->strSiteMapPath . $DomainModel->d_domain;
if (is_dir($strDomainDir) == false) {
mkdir($strDomainDir);
mkdir($strDomainDir, 0777, true);
}
$strMapIndexFile = $strDomainDir . '/sitemap-main.xml';
@@ -600,10 +620,11 @@ EOF;
$isFirst = true;
foreach ($this->fetchVideosByBatch($intStart, $this->intPageSize) as $Video) {
$strSlug = $this->normalizeVideoSlug($Video);
$arrArgs = [
'intVId' => $Video->v_id,
'strPinyin' => $Video->v_name_en,
'strPinYin' => $Video->v_name_en,
'strPinyin' => $strSlug,
'strPinYin' => $strSlug,
];
if ($arrUrlFamily && !empty($arrUrlFamily)) {