feat: topbar legacy-sync button, card view mode with cover fallback, year/month/day archives, richer page cache admin, stylevar repeater editor
- topbar: Livewire LegacySyncButton next to 写文章 (moved from user menu) - view modes: add 图文(card) grid with cover fallback chain (cover → attachment → first content image → placeholder); list mode now title-only compact - archives: year/month/day index grid - page cache admin: size + expiry columns, total size, cache policy note - theme inject: stylevars switch from KeyValue to Repeater with multi-line HTML editing - import: html_entity_decode for category/post-title/link/keywords/comment author
This commit is contained in:
@@ -4,38 +4,78 @@
|
||||
&& blank($post->read_password)
|
||||
&& empty(($post->meta ?? [])['members_only']);
|
||||
@endphp
|
||||
<article class="post-card {{ $post->isPinned() ? 'sticky' : '' }} post-card-{{ $viewMode }}">
|
||||
@if($url = $post->coverImageUrl())
|
||||
@if($viewMode === \App\Blog\Support\HomeViewMode::CARD)
|
||||
<article class="post-card post-card-card {{ $post->isPinned() ? 'sticky' : '' }}">
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}" class="post-cover">
|
||||
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
|
||||
@if($url = $post->coverOrFirstImageUrl())
|
||||
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
|
||||
@else
|
||||
<span class="post-cover-placeholder">{{ \Illuminate\Support\Str::limit($post->title, 24, '') }}</span>
|
||||
@endif
|
||||
</a>
|
||||
@endif
|
||||
<h2 class="post-title">
|
||||
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time>
|
||||
@if($post->category)
|
||||
<span>·</span>
|
||||
<a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
|
||||
<div class="post-card-body">
|
||||
<h2 class="post-title">
|
||||
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
</h2>
|
||||
<div class="post-excerpt">{{ \Illuminate\Support\Str::limit($post->excerpt_or_fallback, 80) }}</div>
|
||||
<div class="post-meta">
|
||||
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format('Y-m-d') }}</time>
|
||||
@if($post->category)
|
||||
<span>·</span>
|
||||
<a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
@elseif($viewMode === \App\Blog\Support\HomeViewMode::LIST)
|
||||
<article class="post-card post-card-list {{ $post->isPinned() ? 'sticky' : '' }}">
|
||||
<h2 class="post-title">
|
||||
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('listtime', 'Y-m-d')) }}</time>
|
||||
@if($post->category)
|
||||
<span>·</span>
|
||||
<a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</article>
|
||||
@else
|
||||
<article class="post-card {{ $post->isPinned() ? 'sticky' : '' }} post-card-{{ $viewMode }}">
|
||||
@if($url = $post->coverImageUrl())
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}" class="post-cover">
|
||||
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
|
||||
</a>
|
||||
@endif
|
||||
<span>· 阅读 {{ $post->views }}</span>
|
||||
<span>· 评论 {{ $post->comment_count }}</span>
|
||||
</div>
|
||||
@if($showFull)
|
||||
<div class="post-content">
|
||||
{!! app(\App\Blog\Services\PostContentRenderer::class)->render($post) !!}
|
||||
<h2 class="post-title">
|
||||
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time>
|
||||
@if($post->category)
|
||||
<span>·</span>
|
||||
<a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
|
||||
@endif
|
||||
<span>· 阅读 {{ $post->views }}</span>
|
||||
<span>· 评论 {{ $post->comment_count }}</span>
|
||||
</div>
|
||||
@else
|
||||
<div class="post-excerpt">
|
||||
{{ \Illuminate\Support\Str::limit($post->excerpt_or_fallback, 200) }}
|
||||
@if($showFull)
|
||||
<div class="post-content">
|
||||
{!! app(\App\Blog\Services\PostContentRenderer::class)->render($post) !!}
|
||||
</div>
|
||||
@else
|
||||
<div class="post-excerpt">
|
||||
{{ \Illuminate\Support\Str::limit($post->excerpt_or_fallback, 200) }}
|
||||
</div>
|
||||
@endif
|
||||
<div class="post-footer">
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 »</a>
|
||||
@foreach($post->tags as $tag)
|
||||
<a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
<div class="post-footer">
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 »</a>
|
||||
@foreach($post->tags as $tag)
|
||||
<a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</article>
|
||||
</article>
|
||||
@endif
|
||||
|
||||
@@ -6,4 +6,6 @@
|
||||
<a href="{{ \App\Blog\Support\HomeViewMode::url(\App\Blog\Support\HomeViewMode::FULL) }}" class="{{ $viewMode === \App\Blog\Support\HomeViewMode::FULL ? 'active' : '' }}">标准</a>
|
||||
<span>|</span>
|
||||
<a href="{{ \App\Blog\Support\HomeViewMode::url(\App\Blog\Support\HomeViewMode::LIST) }}" class="{{ $viewMode === \App\Blog\Support\HomeViewMode::LIST ? 'active' : '' }}">列表</a>
|
||||
<span>|</span>
|
||||
<a href="{{ \App\Blog\Support\HomeViewMode::url(\App\Blog\Support\HomeViewMode::CARD) }}" class="{{ $viewMode === \App\Blog\Support\HomeViewMode::CARD ? 'active' : '' }}">图文</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user