feat(admin): add demo mode toggle in admin dashboard and rewrite 404 page for missing routes
Some checks failed
Production Build & Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Production Build & Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -71,11 +71,13 @@ let page = pages.find((p: any) => {
|
||||
return p.slug === currentSlug || p.slug === `/${currentSlug}`;
|
||||
});
|
||||
|
||||
// 5. Zero-Crash Fallback Guard: Wenn Seite fehlt oder unveröffentlicht ist
|
||||
if (!page || (page.is_published === false && import.meta.env.PROD)) {
|
||||
return Astro.redirect('/404');
|
||||
// 5. Zero-Crash Fallback Guard: Wenn Seite nicht existiert oder nicht veröffentlicht ist -> 404 Status
|
||||
if (!page || (page.is_published === false && !isDraft)) {
|
||||
Astro.response.status = 404;
|
||||
return Astro.rewrite('/404');
|
||||
}
|
||||
|
||||
|
||||
// 6. Dynamic Component Registry Mapping
|
||||
const ComponentRegistry: Record<string, any> = {
|
||||
hero: HeroSection,
|
||||
|
||||
Reference in New Issue
Block a user