Prepare LaySite 1.5.1 page routing and template updates

This commit is contained in:
2026-11-28 03:07:14 +08:00
parent 50fb30ff3b
commit 474cb766be
41 changed files with 354 additions and 146 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ use App\Content\DesignFieldError;
use App\Content\DesignLibrary;
use App\Content\McpSettings;
use App\Content\PageHead;
use App\Content\PageTemplates;
use App\Content\Repository;
use App\Content\SiteDesign;
use App\Content\SiteIcon;
@@ -27,7 +28,7 @@ final class DesignController extends AdminController
}
return $this->render($request, 'admin-design', [
'title' => '站点设计', 'items' => DesignLibrary::palettes(),
'title' => '站点设计', 'items' => DesignLibrary::palettes(), 'defaultPaletteId' => (new Repository())->site()['palette_id'] ?? null,
]);
}
@@ -158,7 +159,7 @@ final class DesignController extends AdminController
return $this->error($request, '找不到这项设计配置。', 404);
}
$repo = new Repository();
$page = $repo->page('home');
$page = $repo->homepage() ?? PageTemplates::find('cobalt-product');
$page[$kind . '_id'] = (int) $id;
return (new SiteController())->renderPage($repo, $page, true);