M2: 主题系统(sablog经典+modern简约)+ 前台全部页面 + 老 URL 301 兼容 + markdown 双份导入

This commit is contained in:
ak
2026-08-11 17:58:29 +08:00
parent f16bb75538
commit 6214976a88
66 changed files with 2763 additions and 10 deletions
@@ -0,0 +1,29 @@
<article class="post-card {{ $post->is_sticky ? 'sticky' : '' }}">
@if($cover = $post->getFirstMedia('cover'))
<a href="{{ route('posts.show', $post->slug ?: $post->id) }}" class="post-cover">
<img src="{{ $cover->getUrl('card') ?: $cover->getUrl() }}" alt="{{ $post->title }}" loading="lazy">
</a>
@endif
<h2 class="post-title">
@if($post->is_sticky)<span class="badge">置顶</span>@endif
<a href="{{ route('posts.show', $post->slug ?: $post->id) }}">{{ $post->title }}</a>
</h2>
<div class="post-meta">
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format('Y-m-d H:i') }}</time>
@if($post->category)
<span>·</span>
<a href="{{ route('category.show', $post->category->slug ?: $post->category->id) }}">{{ $post->category->name }}</a>
@endif
<span>· 阅读 {{ $post->views }}</span>
<span>· 评论 {{ $post->comment_count }}</span>
</div>
<div class="post-excerpt">
{{ Str::limit(strip_tags($post->excerpt_or_fallback), 200) }}
</div>
<div class="post-footer">
<a href="{{ route('posts.show', $post->slug ?: $post->id) }}" class="read-more">阅读全文 &raquo;</a>
@foreach($post->tags as $tag)
<a href="{{ route('tags.show', $tag->slug ?: $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
@endforeach
</div>
</article>