kios-webapp/apps/web/src/pages/[...slug].astro
2024-03-07 15:31:41 +01:00

17 lines
481 B
Plaintext

---
import MainLayout from "../layouts/MainLayout.astro";
import { getPageSingle } from "../services/api";
const { slug } = Astro.params;
const page = await getPageSingle(slug!);
if (!page) return Astro.redirect("/404");
if (page.slug == "home") return Astro.redirect("/");
---
<MainLayout title={page.title} layout={page.layout} description="">
{page.title}
{page.layout}
<!-- {homePage && <RenderPage page={homePage} />}
{!homePage && <NoHomePage />} -->
</MainLayout>