Files

213 lines
14 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{template "header.html"}
<style>
.help-wrap { margin: 0 auto; padding: 10px 0 30px; color: #334155; line-height: 1.75; }
.help-note { margin: 0 0 16px; padding: 12px 16px; background: #f8fafc; border-left: 4px solid #2563eb; color: #475569; }
.help-feature { margin-bottom: 20px; padding: 16px 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; }
.help-feature-title { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: #1e293b; }
.help-feature-desc p { margin: 0 0 8px; }
.help-feature-desc ul { margin: 8px 0 0; padding-left: 20px; }
.help-feature-desc li { margin-bottom: 6px; }
.help-steps { margin: 0; padding-left: 22px; }
.help-step { margin-bottom: 18px; }
.help-step-title { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: #1e293b; }
.help-step-desc { margin: 0; color: #475569; }
.help-summary { margin-top: 18px; padding: 14px 16px; background: #eff6ff; border-radius: 8px; color: #1e40af; }
.help-code { display: inline-block; margin: 2px 0; padding: 2px 8px; font-family: Consolas, monospace; font-size: 13px; background: #f1f5f9; border-radius: 4px; color: #0f172a; word-break: break-all; }
.help-pre { margin: 8px 0; padding: 12px 14px; font-family: Consolas, monospace; font-size: 13px; background: #0f172a; color: #e2e8f0; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }
.help-table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 13px; }
.help-table th, .help-table td { padding: 8px 10px; border: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.help-table th { background: #f8fafc; font-weight: 600; }
.help-link { color: #2563eb; text-decoration: none; }
.help-link:hover { text-decoration: underline; }
</style>
<div class="portlet light bordered">
<div class="portlet-title tabbable-line">
<ul class="nav nav-tabs" style="float:left;">
<li class="{if $page==0}active{/if}">
<a href="{dr_url('module/help/seo', ['page' => 0])}"><i class="fa fa-sitemap"></i> {dr_lang('配置层级')}</a>
</li>
<li class="{if $page==1}active{/if}">
<a href="{dr_url('module/help/seo', ['page' => 1])}"><i class="fa fa-tags"></i> {dr_lang('通配符')}</a>
</li>
<li class="{if $page==2}active{/if}">
<a href="{dr_url('module/help/seo', ['page' => 2])}"><i class="fa fa-list-ol"></i> {dr_lang('配置流程')}</a>
</li>
</ul>
</div>
<div class="portlet-body">
<div class="help-wrap">
{if $page==0}
<div class="help-section-body">
<p class="help-note">{dr_lang('SEO 按「站点 → 模块 → 栏目」分层配置,下层可覆盖上层规则;内容页还可使用文章自身的 title/keywords/description 字段。')}</p>
<table class="help-table">
<thead>
<tr><th>{dr_lang('层级')}</th><th>{dr_lang('配置范围')}</th><th>{dr_lang('后台入口')}</th></tr>
</thead>
<tbody>
<tr>
<td>{dr_lang('站点 SEO')}</td>
<td>{dr_lang('全站首页 title/keywords/descriptionSEO 连接符;全站 URL 规则;网站首页静态')}</td>
<td><a class="help-link" href="{dr_url('module/seo_site/index')}">{dr_lang('站点SEO')}</a></td>
</tr>
<tr>
<td>{dr_lang('模块 SEO')}</td>
<td>{dr_lang('模块首页、栏目列表、内容详情、搜索页的 SEO 模板;模块 URL 规则(独立模块)')}</td>
<td><a class="help-link" href="{dr_url('module/seo_module/index')}">{dr_lang('模块SEO')}</a></td>
</tr>
<tr>
<td>{dr_lang('栏目 SEO')}</td>
<td>{dr_lang('为单个栏目单独设置列表页/内容页 SEO(模块 SEO 中开启「分别设置」后生效)')}</td>
<td><a class="help-link" href="{dr_url('module/seo_category/index')}">{dr_lang('栏目SEO')}</a></td>
</tr>
<tr>
<td>{dr_lang('内容 SEO')}</td>
<td>{dr_lang('发布内容时填写标题、关键词、描述;优先于模块模板中的通配符')}</td>
<td><a class="help-link" href="{dr_url('module/content/index')}">{dr_lang('内容管理')}</a></td>
</tr>
</tbody>
</table>
<div class="help-feature" style="margin-top:20px;">
<h3 class="help-feature-title">{dr_lang('SEO 连接符')}</h3>
<div class="help-feature-desc">
<p>{dr_lang('在')} <a class="help-link" href="{dr_url('module/seo_site/index')}">{dr_lang('站点SEO')}</a> {dr_lang('中设置')} <span class="help-code">SITE_SEOJOIN</span>{dr_lang('默认')} <span class="help-code">_</span>),{dr_lang('用于拼接标题中的多个部分。')}</p>
<p>{dr_lang('模板中的')} {code}{join}{/code} {dr_lang('会被替换为该连接符,例如:')} {code}文章标题{join}栏目名称{join}网站名称{/code}</p>
</div>
</div>
<div class="help-feature">
<h3 class="help-feature-title">{dr_lang('前台输出')}</h3>
<div class="help-feature-desc">
<p>{dr_lang('系统计算后的 SEO 会赋值给模板变量:')}</p>
<ul>
<li>{code}{$meta_title}{/code} — {dr_lang('页面 title')}</li>
<li>{code}{$meta_keywords}{/code} — {dr_lang('keywords')}</li>
<li>{code}{$meta_description}{/code} — {dr_lang('description')}</li>
</ul>
<p>{dr_lang('一般在')} {code}header.html{/code} {dr_lang('的 head 区域输出。')}</p>
</div>
</div>
</div>
{/if}
{if $page==1}
<div class="help-section-body">
<p class="help-note">{dr_lang('SEO 模板中使用花括号通配符,保存后系统自动替换为实际值。分页页码用')} {code}[第&#123;page&#125;&#123;join&#125;]{/code} {dr_lang('格式(方括号表示仅分页时显示)。')}</p>
<div class="help-feature">
<h3 class="help-feature-title">{dr_lang('通用通配符')}</h3>
<div class="help-feature-desc">
<table class="help-table">
<thead>
<tr><th>{dr_lang('通配符')}</th><th>{dr_lang('说明')}</th></tr>
</thead>
<tbody>
<tr><td>{code}{SITE_NAME}{/code}</td><td>{dr_lang('网站名称')}</td></tr>
<tr><td>{code}{join}{/code}</td><td>{dr_lang('SEO 连接符(站点 SEO 中设置)')}</td></tr>
<tr><td>{code}{page}{/code}</td><td>{dr_lang('分页页码')}</td></tr>
<tr><td>{code}{modname}{/code}</td><td>{dr_lang('模块名称')}</td></tr>
<tr><td>{code}{name}{/code} / {code}{catname}{/code}</td><td>{dr_lang('栏目名称')}</td></tr>
<tr><td>{code}{catpname}{/code}</td><td>{dr_lang('栏目层级路径名称(含上级)')}</td></tr>
<tr><td>{code}{title}{/code}</td><td>{dr_lang('内容标题')}</td></tr>
<tr><td>{code}{keyword}{/code}</td><td>{dr_lang('搜索关键词')}</td></tr>
<tr><td>{code}{param}{/code}</td><td>{dr_lang('搜索附加参数')}</td></tr>
</tbody>
</table>
</div>
</div>
<div class="help-feature">
<h3 class="help-feature-title">{dr_lang('常用模板示例')}</h3>
<div class="help-feature-desc">
<p><strong>{dr_lang('内容页标题(默认)')}</strong></p>
<pre class="help-pre">{code}[第{page}页{join}]{title}{join}{catpname}{join}{SITE_NAME}{/code}</pre>
<p><strong>{dr_lang('栏目列表页标题(默认)')}</strong></p>
<pre class="help-pre">{code}[第{page}页{join}]{catpname}{join}{SITE_NAME}{/code}</pre>
<p><strong>{dr_lang('搜索页标题(默认)')}</strong></p>
<pre class="help-pre">{code}[第{page}页{join}][{keyword}{join}][{param}{join}]{SITE_NAME}{/code}</pre>
<p>{dr_lang('模块 SEO 配置页中点击「可用通配符标签」按钮,可查看当前页面支持的全部通配符。')}</p>
</div>
</div>
<div class="help-feature">
<h3 class="help-feature-title">{dr_lang('内容自定义字段')}</h3>
<div class="help-feature-desc">
<p>{dr_lang('模块内容字段、栏目字段也可参与 SEO 通配符替换(在模块 SEO 的通配符列表中查看)。自定义字段需在字段管理中勾选参与 SEO。')}</p>
</div>
</div>
</div>
{/if}
{if $page==2}
<div class="help-section-body">
<p class="help-note">{dr_lang('建议按以下顺序配置 SEO,修改后执行系统缓存更新,并访问前台验证页面 source 中的 title/meta 标签。')}</p>
<ol class="help-steps">
<li class="help-step">
<span class="help-step-title">{dr_lang('第一步:站点 SEO')}</span>
<p class="help-step-desc">
进入 <a class="help-link" href="{dr_url('module/seo_site/index')}">{dr_lang('站点SEO')}</a>
填写首页 title/keywords/description,设置 SEO 连接符;
如需全站统一 URL 格式,选择全局 URL 规则。
</p>
</li>
<li class="help-step">
<span class="help-step-title">{dr_lang('第二步:模块 SEO')}</span>
<p class="help-step-desc">
进入 <a class="help-link" href="{dr_url('module/seo_module/index')}">{dr_lang('模块SEO')}</a>
按模块 Tab 分别设置首页、栏目列表、内容详情、搜索页的 SEO 模板;
独立模块可在此绑定模块 URL 规则。
</p>
</li>
<li class="help-step">
<span class="help-step-title">{dr_lang('第三步:栏目 SEO(可选)')}</span>
<p class="help-step-desc">
若某栏目需独立 SEO,在模块 SEO 中将「按栏目设置 SEO」改为「分别设置」,
再到 <a class="help-link" href="{dr_url('module/seo_category/index')}">{dr_lang('栏目SEO')}</a> 逐栏配置。
</p>
</li>
<li class="help-step">
<span class="help-step-title">{dr_lang('第四步:内容 SEO')}</span>
<p class="help-step-desc">
发布/编辑内容时填写 SEO 标题、关键词、描述;
留空则使用模块 SEO 模板通配符自动生成。
</p>
</li>
<li class="help-step">
<span class="help-step-title">{dr_lang('第五步:更新与验证')}</span>
<p class="help-step-desc">
修改 SEO 规则或 URL 规则后,点击各 SEO 页顶部的「设置全站SEO规则」或执行系统缓存更新;
访问首页、列表、详情、搜索页,查看浏览器标题与 meta 是否符合预期。
</p>
</li>
</ol>
<div class="help-feature" style="margin-top:20px;">
<h3 class="help-feature-title">{dr_lang('常见问题')}</h3>
<div class="help-feature-desc">
<ul>
<li><strong>{dr_lang('修改后前台无变化')}</strong>{dr_lang('更新系统缓存;清除浏览器缓存;若开启静态化需重新生成')}</li>
<li><strong>{dr_lang('分页标题无页码')}</strong>{dr_lang('确认模板含')} {code}[第&#123;page&#125;&#123;join&#125;]{/code} {dr_lang('且当前为第 2 页及以上')}</li>
<li><strong>{dr_lang('栏目 SEO 不生效')}</strong>{dr_lang('检查模块 SEO 是否已开启「分别设置」;共享模块需在栏目 SEO 页操作')}</li>
</ul>
</div>
</div>
<div class="help-summary">
<strong>{dr_lang('相关')}</strong>
{dr_lang('自定义链接格式见')}
<a class="help-link" href="{dr_url('module/help/url')}">{dr_lang('自定义URL用法')}</a>
</div>
</div>
{/if}
</div>
</div>
</div>
{template "footer.html"}