Clone starter
This commit is contained in:
12
apps/web/src/pages/404.astro
Normal file
12
apps/web/src/pages/404.astro
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
import MainLayout from "../layouts/MainLayout.astro";
|
||||
import { getLayoutSingle } from "../services/api/layout.service";
|
||||
|
||||
const layout = await getLayoutSingle("404");
|
||||
---
|
||||
|
||||
<MainLayout title="Error 404" layout={layout} description="Page not found">
|
||||
Not found, error 404 The page you are looking for no longer exists. Perhaps
|
||||
you can return back to the homepage and see if you can find what you are
|
||||
looking for. Or, you can try finding it by using the search form below.
|
||||
</MainLayout>
|
||||
16
apps/web/src/pages/[...slug].astro
Normal file
16
apps/web/src/pages/[...slug].astro
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
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>
|
||||
18
apps/web/src/pages/index.astro
Normal file
18
apps/web/src/pages/index.astro
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
import MainLayout from "../layouts/MainLayout.astro";
|
||||
import { getPageSingle } from "../services/api";
|
||||
|
||||
const homePage = await getPageSingle("home");
|
||||
|
||||
const pageTitle = homePage?.meta?.title ?? homePage?.title ?? "TurboPress";
|
||||
|
||||
const layout = homePage?.layout;
|
||||
---
|
||||
|
||||
<MainLayout
|
||||
title={pageTitle}
|
||||
{layout}
|
||||
description={homePage?.meta?.description}
|
||||
content={homePage?.content}
|
||||
image={homePage?.meta?.image}
|
||||
/>
|
||||
Reference in New Issue
Block a user