Merge branch 'main' of gitea.neatcn.com:gouki/laralog
Build and Deploy / verify (push) Successful in 34s
Build and Deploy / deploy (push) Successful in 40s

Keep media-library covers while adopting sablog /show-{id}.shtml canonical URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gouki
2026-09-16 19:06:42 +00:00
co-authored by Cursor
23 changed files with 116 additions and 73 deletions
@@ -11,7 +11,7 @@
<h3>分类</h3>
<ul>
@forelse($categories as $category)
<li><a href="{{ route('category.show', $category->slug ?: $category->id) }}">{{ $category->name }}</a> ({{ $category->post_count }})</li>
<li><a href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a> ({{ $category->post_count }})</li>
@empty
<li>暂无分类</li>
@endforelse
@@ -22,7 +22,7 @@
<h3>最新文章</h3>
<ul>
@forelse($recentPosts as $post)
<li><a href="{{ route('posts.show', $post->slug ?: $post->id) }}">{{ $post->title }}</a></li>
<li><a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li>
@empty
<li>暂无文章</li>
@endforelse
@@ -33,7 +33,7 @@
<h3>最新评论</h3>
<ul>
@forelse($recentComments as $comment)
<li><a href="{{ route('posts.show', $comment->post->slug ?: $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 20) }}</a></li>
<li><a href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 20) }}</a></li>
@empty
<li>暂无评论</li>
@endforelse
@@ -44,7 +44,7 @@
<h3>标签</h3>
<p class="tagcloud">
@forelse($hotTags as $tag)
<a href="{{ route('tags.show', $tag->slug ?: $tag->name) }}">{{ $tag->name }}</a>
<a href="{{ route('tags.show', $tag->name) }}">{{ $tag->name }}</a>
@empty
暂无标签
@endforelse
+2 -2
View File
@@ -38,7 +38,7 @@
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time>
@if($post->author)<span>· {{ $post->author->name }}</span>@endif
@if($post->category)
<span>· <a href="{{ route('category.show', $post->category->slug ?: $post->category->id) }}">{{ $post->category->name }}</a></span>
<span>· <a href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a></span>
@endif
<span>· 阅读 {{ $post->views }}</span>
</div>
@@ -52,7 +52,7 @@
@if($post->tags->isNotEmpty())
<div class="post-tags">
@foreach($post->tags as $tag)
<a href="{{ route('tags.show', $tag->slug ?: $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
@endforeach
</div>
@endif