依据 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:
2026-08-08 23:19:35 +08:00
parent f9f26ef1cc
commit 63431dd77c
8 changed files with 267 additions and 1 deletions
+31
View File
@@ -48,6 +48,37 @@
@endif
</article>
@php
// 结构化数据:Article + BreadcrumbList(审计 SEO-05 / GEO-03 作者与发布信号)
$logoUrl = '/images/logo-dark.png';
$articleSchema = [
'@context' => 'https://schema.org',
'@type' => 'Article',
'headline' => $article->title,
'description' => $article->seoDescription(),
'author' => ['@type' => 'Organization', 'name' => $siteName],
'publisher' => [
'@type' => 'Organization',
'name' => $siteName,
'logo' => ['@type' => 'ImageObject', 'url' => asset($logoUrl)],
],
'datePublished' => $article->published_at?->toIso8601String(),
'dateModified' => $article->updated_at?->toIso8601String(),
'mainEntityOfPage' => ['@type' => 'WebPage', '@id' => url()->current()],
];
$breadcrumbSchema = [
'@context' => 'https://schema.org',
'@type' => 'BreadcrumbList',
'itemListElement' => [
['@type' => 'ListItem', 'position' => 1, 'name' => '首页', 'item' => url('/')],
['@type' => 'ListItem', 'position' => 2, 'name' => '技术文章', 'item' => route('articles.index')],
['@type' => 'ListItem', 'position' => 3, 'name' => $article->title, 'item' => url()->current()],
],
];
@endphp
<script type="application/ld+json">{!! json_encode($articleSchema, 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('articles.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" /> 返回文章列表