Thinking about data pipeline

This commit is contained in:
2025-11-17 14:12:46 +13:00
parent 7145714151
commit 02724d9986
3 changed files with 32 additions and 0 deletions

View File

@@ -7,6 +7,8 @@ import tailwindcss from '@tailwindcss/vite';
// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: node({
mode: 'standalone'
}),

View File

@@ -0,0 +1,13 @@
---
const { title, description, tags } = Astro.props
---
<div>
{title}<br>
{description}<br>
{tags.join(", ")}<br>
</div>

View File

@@ -1,6 +1,23 @@
---
import { Recipe } from "@tmlmt/cooklang-parser"
import { authPB } from "@data/pb";
import RecipeCard from "@component/index/card"
import Base from "@layout/Base";
const pb = await authPB()
const records = await pb.collection('recipes').getFullList()
const recipes = records.map(r => new Recipe(r.cooklang))
---
<Base>
{
recipes.map(r => (
<RecipeCard
title={r.metadata.title ?? "Untitled Recipe"}
description={r.metadata.description ?? "No Description"}
tags={r.metadata.tags ?? []}
/>
))
}
</Base>