feat: restore sablog browse modes and clean imported HTML
Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
<article class="post-card {{ $post->is_sticky ? 'sticky' : '' }}">
|
||||
@php
|
||||
$viewMode = $homeViewMode ?? \App\Blog\Support\HomeViewMode::LIST;
|
||||
$showFull = $viewMode === \App\Blog\Support\HomeViewMode::FULL
|
||||
&& blank($post->read_password)
|
||||
&& empty(($post->meta ?? [])['members_only']);
|
||||
@endphp
|
||||
<article class="post-card {{ $post->isPinned() ? 'sticky' : '' }} post-card-{{ $viewMode }}">
|
||||
@if($url = $post->coverImageUrl())
|
||||
<a href="{{ route('posts.show', $post->id) }}" class="post-cover">
|
||||
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
|
||||
</a>
|
||||
@endif
|
||||
<h2 class="post-title">
|
||||
@if($post->is_sticky)<span class="badge">置顶</span>@endif
|
||||
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
|
||||
<a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
@@ -17,9 +23,15 @@
|
||||
<span>· 阅读 {{ $post->views }}</span>
|
||||
<span>· 评论 {{ $post->comment_count }}</span>
|
||||
</div>
|
||||
<div class="post-excerpt">
|
||||
{{ Str::limit(strip_tags($post->excerpt_or_fallback), 200) }}
|
||||
</div>
|
||||
@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 href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 »</a>
|
||||
@foreach($post->tags as $tag)
|
||||
|
||||
Reference in New Issue
Block a user