[PIE-8] Add recipe detail view #6
@ -10,7 +10,9 @@ import Header from "@/components/Header";
|
|||||||
<body>
|
<body>
|
||||||
<main id="main" class="flex-1">
|
<main id="main" class="flex-1">
|
||||||
<Header/>
|
<Header/>
|
||||||
<slot />
|
<div class="px-5 pt-2">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,18 +7,16 @@ const recipies = await client.collection("recipes").getFullList()
|
|||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<div id="content" class="p-5 pt-2">
|
<!-- <p class="pb-2">What would you like today?</p> -->
|
||||||
<!-- <p class="pb-2">What would you like today?</p> -->
|
|
||||||
|
|
||||||
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
|
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
|
||||||
{
|
{
|
||||||
recipies.map(r => (
|
recipies.map(r => (
|
||||||
<a href={`/recipe/${r.id}`}>
|
<a href={`/recipe/${r.id}`}>
|
||||||
<OverviewCard recipe={r} />
|
<OverviewCard recipe={r} />
|
||||||
</a>
|
</a>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
---
|
---
|
||||||
import client from "@/data/pocketbase";
|
import client from "@/data/pocketbase";
|
||||||
|
import SiteLayout from "@/layouts/base";
|
||||||
const { slug } = Astro.params;
|
const { slug } = Astro.params;
|
||||||
|
|
||||||
const re = await client.collection("recipes").getOne(slug ?? "0");
|
const re = await client.collection("recipes").getOne(slug ?? "0");
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
{re.name}
|
<SiteLayout>
|
||||||
|
{re.name}
|
||||||
|
</SiteLayout>
|
Loading…
x
Reference in New Issue
Block a user