feat: restore sablog browse modes and clean imported HTML
Build and Deploy / verify (push) Successful in 40s
Build and Deploy / deploy (push) Successful in 36s

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:
gouki
2026-09-18 21:33:02 +00:00
co-authored by Cursor
parent 469160dc3f
commit ae47447062
98 changed files with 8618 additions and 901 deletions
+39 -4
View File
@@ -4,10 +4,16 @@ declare(strict_types=1);
namespace App\Providers;
use App\Blog\Support\HomeViewMode;
use App\Blog\Support\PageCacheMiddleware;
use App\Blog\Support\PluginManager;
use App\Models\MarketPackage;
use Filament\Facades\Filament;
use Filament\View\PanelsRenderHook;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Plugins\Neatstudio\Payment\Models\Payment;
class AppServiceProvider extends ServiceProvider
{
@@ -21,16 +27,16 @@ class AppServiceProvider extends ServiceProvider
private function registerMarketPurchaseListener(): void
{
$manager = app(\App\Blog\Support\PluginManager::class);
$manager = app(PluginManager::class);
if (! $manager->isEnabled('neatstudio.payment')) {
return;
}
$manager->addAction('payment.paid', function (\Plugins\Neatstudio\Payment\Models\Payment $payment) {
$manager->addAction('payment.paid', function (Payment $payment) {
$payable = $payment->payable;
if ($payable instanceof \App\Models\MarketPackage) {
if ($payable instanceof MarketPackage) {
$payable->markPaid($payment);
}
}, 10);
@@ -54,7 +60,20 @@ class AppServiceProvider extends ServiceProvider
$this->registerMarketPurchaseListener();
// 前台页面缓存(匿名 GET,缓存含 SEO 注入后的最终 HTML)
app('router')->pushMiddlewareToGroup('web', \App\Blog\Support\PageCacheMiddleware::class);
app('router')->pushMiddlewareToGroup('web', PageCacheMiddleware::class);
View::composer([
'index',
'list',
'tag',
'search',
'partials.post-card',
'partials.view-mode-switcher',
], function ($view): void {
if (! $view->offsetExists('homeViewMode')) {
$view->with('homeViewMode', HomeViewMode::current());
}
});
// 后台紧凑化:侧边栏 + 表格行 + 筛选区(Filament 无官方全局紧凑开关,用 CSS 收紧)
Filament::serving(function () {
@@ -96,6 +115,22 @@ class AppServiceProvider extends ServiceProvider
/* 文章编辑框加大(MarkdownEditor 基于 tiptap) */
.fi-fo-markdown-editor .tiptap, .fi-fo-markdown-editor .ProseMirror { min-height: 26rem !important; }
/* 封面/媒体预览:禁止按栏宽 100% 拉伸,否则大图会把编辑页撑烂 */
.ll-media-picker-preview img,
img.h-32.max-w-full.rounded-md.object-contain {
max-width: 220px !important;
max-height: 124px !important;
width: auto !important;
height: auto !important;
object-fit: contain !important;
display: block !important;
}
.ll-media-picker-preview .relative,
.relative.rounded-lg:has(> img.h-32.max-w-full) {
width: fit-content;
max-width: 15rem;
}
/* 筛选条件区:整体一行横排,重置紧跟应用按钮,控件紧凑 */
.fi-ta-filters-above-content-ctn { padding: 0.4rem 0.9rem !important; }
.fi-ta-filters-heading { display: none !important; }