fix(hjc-web): 修复首页标题重复为「XX - XX」
index.vue 把 title 传成了 siteName,而 usePageSeo 又会自动拼上
「 - {站点名}」后缀,于是品牌名出现两次:
「广西汇吉采咨询有限公司 - 广西汇吉采咨询有限公司」。
title 改为固定的栏目定位「官网首页」,品牌名统一交给后缀拼接,
渲染为「官网首页 - 广西汇吉采咨询有限公司」,与站内其它页面
(如「关于我们 - 广西汇吉采咨询有限公司」)保持一致。
This commit is contained in:
+5
-2
@@ -9,13 +9,16 @@
|
|||||||
* 首页路由
|
* 首页路由
|
||||||
* 使用 SiteHome 组件动态加载当前模板的首页
|
* 使用 SiteHome 组件动态加载当前模板的首页
|
||||||
*/
|
*/
|
||||||
const { siteInfo, siteName, fetchSiteInfo } = useSite()
|
const { siteInfo, fetchSiteInfo } = useSite()
|
||||||
|
|
||||||
await fetchSiteInfo()
|
await fetchSiteInfo()
|
||||||
|
|
||||||
|
// 首页标题:usePageSeo 会自动把 title 拼成「{title} - {站点名}」,
|
||||||
|
// 所以这里只传栏目定位,品牌名交给后缀。
|
||||||
|
// 曾经这里传的是 siteName,于是渲染出「XX - XX」的重复标题。
|
||||||
usePageSeo(
|
usePageSeo(
|
||||||
{
|
{
|
||||||
title: siteName.value || '首页',
|
title: '官网首页',
|
||||||
description: siteInfo.value?.comments || undefined,
|
description: siteInfo.value?.comments || undefined,
|
||||||
keywords: siteInfo.value?.keywords || undefined,
|
keywords: siteInfo.value?.keywords || undefined,
|
||||||
path: '/'
|
path: '/'
|
||||||
|
|||||||
Reference in New Issue
Block a user