依据 SECURITY_SEO_AUDIT.md 实施第一轮安全/SEO/GEO 修复
代码改动: - SEO-02 产品页标题品牌重复:Product::seoTitle() 去掉品牌后缀,由视图统一追加 $siteName - SEO-05/Geo-03 结构化数据:布局增 WebSite+SearchAction;产品页 Product+BreadcrumbList;文章页 Article+BreadcrumbList(含作者/发布日期) - SEO-06 hreflang 自引用(zh-CN/x-default) - SEC-02 新增 public/.well-known/security.txt - GEO-05 新增 public/llms.txt 记录文档(供未来开发者接手): - CHANGELOG.md:版本与变更日志 - docs/SECURITY_SEO_REMEDIATION.md:逐项状态总表 + 改动位置 + 上线 curl 自检清单 (SEC-01/REL-01~03/PHY-01~04 等需 Tailwind 构建或云端操作项标记为待办,未自动改以免破坏站点)
This commit is contained in:
@@ -35,6 +35,30 @@
|
||||
@endif
|
||||
</article>
|
||||
|
||||
@php
|
||||
// 结构化数据:Product + BreadcrumbList(审计 SEO-05)
|
||||
$productSchema = [
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'Product',
|
||||
'name' => $product->name,
|
||||
'description' => $product->seoDescription(),
|
||||
'brand' => ['@type' => 'Brand', 'name' => $siteName],
|
||||
'url' => url()->current(),
|
||||
'category' => $product->category?->name,
|
||||
];
|
||||
$breadcrumbSchema = [
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'BreadcrumbList',
|
||||
'itemListElement' => [
|
||||
['@type' => 'ListItem', 'position' => 1, 'name' => '首页', 'item' => url('/')],
|
||||
['@type' => 'ListItem', 'position' => 2, 'name' => '产品中心', 'item' => route('products.index')],
|
||||
['@type' => 'ListItem', 'position' => 3, 'name' => $product->name, 'item' => url()->current()],
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<script type="application/ld+json">{!! json_encode($productSchema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG) !!}</script>
|
||||
<script type="application/ld+json">{!! json_encode($breadcrumbSchema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG) !!}</script>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ route('products.index') }}" class="inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:text-primary-hover">
|
||||
<x-icon name="arrow" :size="16" class="rotate-180" /> 返回产品中心
|
||||
|
||||
Reference in New Issue
Block a user