feat: use xpier media library for uploads and markdown embeds

Store media:ID in post bodies instead of CDN URLs, and keep sablog attach tokens as a fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gouki
2026-09-16 19:03:52 +00:00
co-authored by Cursor
parent f6a9a8ea50
commit f81397a289
38 changed files with 5390 additions and 2059 deletions
+3 -3
View File
@@ -9,10 +9,10 @@
<main class="content">
<h1 class="list-title">{{ $archiveTitle ?? ($category->name ?? '文章列表') }}</h1>
@if(isset($category) && ($category->description || $category->getFirstMedia('cover')))
@if(isset($category) && ($category->description || $category->coverImageUrl()))
<div class="category-intro">
@if($cover = $category->getFirstMedia('cover'))
<img src="{{ $cover->getUrl() }}" alt="{{ $category->name }}" class="category-cover">
@if($url = $category->coverImageUrl())
<img src="{{ $url }}" alt="{{ $category->name }}" class="category-cover">
@endif
<div>
@if($category->description)
+2 -2
View File
@@ -7,9 +7,9 @@
@endphp
<div class="paywall" role="note" aria-label="付费内容">
@if($cover = $post->getFirstMedia('cover'))
@if($url = $post->coverImageUrl())
<div class="paywall-cover">
<img src="{{ $cover->getUrl('card') ?: $cover->getUrl() }}" alt="{{ $post->title }}">
<img src="{{ $url }}" alt="{{ $post->title }}">
</div>
@endif
+2 -2
View File
@@ -1,7 +1,7 @@
<article class="post-card {{ $post->is_sticky ? 'sticky' : '' }}">
@if($cover = $post->getFirstMedia('cover'))
@if($url = $post->coverImageUrl())
<a href="{{ route('posts.show', $post->slug ?: $post->id) }}" class="post-cover">
<img src="{{ $cover->getUrl('card') ?: $cover->getUrl() }}" alt="{{ $post->title }}" loading="lazy">
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
</a>
@endif
<h2 class="post-title">
+2 -2
View File
@@ -30,9 +30,9 @@
</details>
</nav>
@endif
@if($cover = $post->getFirstMedia('cover'))
@if($url = $post->coverImageUrl())
<div class="post-cover">
<img src="{{ $cover->getUrl('card') ?: $cover->getUrl() }}" alt="{{ $post->title }}">
<img src="{{ $url }}" alt="{{ $post->title }}">
</div>
@endif
<h1 class="post-title">{{ $post->title }}</h1>