feat: Markdown 正文自动 TOC(锚点+折叠目录)+ 社交账号扩充国内平台(B站/小红书/抖音/视频号/公众号/其他)+ 侧边栏社交展示 + JSON-LD sameAs 全平台聚合 + 首页 h1(SEO 语义)
This commit is contained in:
@@ -158,3 +158,15 @@ a:hover { opacity: 0.8; }
|
||||
.pagination-links { gap: 6px; }
|
||||
.pagination-links a, .pagination-links .current, .pagination-links .disabled { padding: 5px 10px; }
|
||||
}
|
||||
|
||||
/* TOC */
|
||||
.toc { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin: 0 0 18px; font-size: 14px; }
|
||||
.toc summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
|
||||
.toc-list { list-style: none; }
|
||||
.toc-list li { padding: 3px 0; }
|
||||
.toc-list a { color: var(--muted); }
|
||||
.toc-list a:hover { color: var(--accent); }
|
||||
.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; }
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user