--- import Layout from "@layouts/Layout.astro"; import { useTranslatedPath } from "@i18n/utils"; import markdownToText from "@helpers/markdownToText"; import * as memorium from "@helpers/memorium"; const path = useTranslatedPath(Astro.url); const collection = "resources/Recipes"; export async function getStaticPaths() { const recipes = await memorium.listResource("Recipes"); const paths = recipes.content.filter(res =>res.content).map((recipe: any) => { return { params: { recipeName: recipe.name.replace(/\.md$/, ""), }, }; }); return paths; } const recipeResponse = await memorium.listResource( //@ts-ignore `Recipes/${Astro.params.recipeName}.md`, ); if (!recipeResponse?.content) { return new Response(null, { status: 404, statusText: "Not found", }); } const recipe = recipeResponse.content; ---
back
{ recipe.date?.toLocaleString("en-US", { month: "long", day: "numeric", year: "numeric", }) }

{recipe.name}

Ingredients

Instructions

    { recipe.recipeIngredient?.map((ingredient: any) => (
  1. {markdownToText(ingredient??"")}
  2. )) }