feat: Markdown 正文自动 TOC(锚点+折叠目录)+ 社交账号扩充国内平台(B站/小红书/抖音/视频号/公众号/其他)+ 侧边栏社交展示 + JSON-LD sameAs 全平台聚合 + 首页 h1(SEO 语义)

This commit is contained in:
ak
2026-08-11 23:49:19 +08:00
parent 489a145259
commit 56735804a1
26 changed files with 249 additions and 13 deletions
+10
View File
@@ -134,3 +134,13 @@ a:hover { color: #f60; text-decoration: underline; }
.post-full .post-title { font-size: 22px; }
.archive-posts { margin-left: 10px; }
}
/* TOC */
.toc { background: #f7f9fb; border: 1px solid #d8dfe6; padding: 10px 14px; margin: 0 0 14px; font-size: 13px; }
.toc summary { cursor: pointer; font-weight: bold; margin-bottom: 4px; }
.toc-list { list-style: none; }
.toc-list li { padding: 2px 0; }
.toc-level-3 { padding-left: 14px; }
.toc-level-4, .toc-level-5, .toc-level-6 { padding-left: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
+1
View File
@@ -3,6 +3,7 @@
@include('partials.header')
<div id="page">
<main id="content">
<h1 class="sr-only">{{ $siteName }}</h1>
@if(session('success'))
<div class="alert alert-success">{{ session('success') }}</div>
@endif
@@ -62,6 +62,19 @@
</ul>
</section>
<section class="widget">
<h3>社交账号</h3>
<ul class="social-links">
@foreach($socialLinks as $social)
@if($social['url'])
<li><a href="{{ $social['url'] }}" target="_blank" rel="noopener nofollow">{{ $social['platform'] }}</a></li>
@else
<li>{{ $social['platform'] }}{{ $social['value'] }}</li>
@endif
@endforeach
</ul>
</section>
<section class="widget">
<h3>统计</h3>
<ul>
+14
View File
@@ -16,6 +16,20 @@
@endif
<article class="post-full">
@if(! empty($toc))
<nav class="toc" aria-label="文章目录">
<details open>
<summary>目录</summary>
<ol class="toc-list">
@foreach($toc as $item)
<li class="toc-level-{{ $item['level'] }}">
<a href="#{{ $item['id'] }}">{{ $item['text'] }}</a>
</li>
@endforeach
</ol>
</details>
</nav>
@endif
@if($cover = $post->getFirstMedia('cover'))
<div class="post-cover"><img src="{{ $cover->getUrl('card') ?: $cover->getUrl() }}" alt="{{ $post->title }}"></div>
@endif