Allow deleting and recreating the homepage

This commit is contained in:
2026-11-28 02:06:27 +08:00
parent 268a278ec1
commit a0df3e60de
11 changed files with 31 additions and 27 deletions
-3
View File
@@ -174,9 +174,6 @@ final class Repository
public function deletePage(string $slug, int $version): bool
{
if ($slug === 'home') {
throw new RuntimeException('首页是站点入口,不能删除。');
}
return Database::write(function (PDO $pdo) use ($slug, $version): bool {
$page = $this->one('SELECT pages.layout_id, d.kind AS layout_kind FROM pages
LEFT JOIN design_presets d ON pages.layout_id = d.id WHERE pages.slug = ?', [$slug]);