Files
Lucanlee 63431dd77c 依据 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 构建或云端操作项标记为待办,未自动改以免破坏站点)
2026-08-08 23:19:35 +08:00

70 lines
3.5 KiB
PHP
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.
@extends('layouts.app')
@php $siteName = App\Models\Setting::get('site_name', '深圳市云创芯电子有限公司'); @endphp
@section('title', $product->seoTitle() . ' - ' . $siteName)
@section('description', $product->seoDescription())
@section('content')
<section class="px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
<div class="mx-auto max-w-5xl">
<nav class="mb-6 flex items-center gap-1.5 text-sm text-muted">
<a href="{{ url('/') }}" class="hover:text-primary">首页</a>
<span>/</span>
<a href="{{ route('products.index') }}" class="hover:text-primary">产品中心</a>
<span>/</span>
<span class="text-fg">{{ $product->name }}</span>
</nav>
<article class="rounded-lg border border-line bg-surface p-6 shadow-soft sm:p-8">
<span class="inline-block rounded bg-primary-soft px-2 py-1 font-mono text-xs font-medium text-primary">{{ $product->model ?: $product->slug }}</span>
<h1 class="mt-4 text-2xl font-bold tracking-tight text-fg sm:text-3xl">{{ $product->name }}</h1>
@if ($product->category)
<p class="mt-2 text-sm text-muted">分类:{{ $product->category->name }}</p>
@endif
@if ($product->summary)
<p class="mt-4 text-base text-muted">{{ $product->summary }}</p>
@endif
@if ($product->description)
<div class="prose mt-6 text-fg">
{!! nl2br(e($product->description)) !!}
</div>
@endif
@if ($product->specs)
<h2 class="mt-8 text-lg font-semibold text-fg">规格参数</h2>
<pre class="mt-3 overflow-x-auto rounded-lg border border-line bg-surface-2 p-4 font-mono text-sm text-fg">{{ $product->specs }}</pre>
@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" /> 返回产品中心
</a>
</div>
</div>
</section>
@endsection