feat: display articles
Some checks failed
Deploy to SFTP Server / build (push) Failing after 1m38s

This commit is contained in:
Max Richter
2025-10-22 17:17:34 +02:00
parent 3a120e32fc
commit ae266dbdc5
10 changed files with 121 additions and 47 deletions

View File

@@ -0,0 +1,32 @@
---
import * as memorium from "@helpers/memorium";
import { markdownToHtml, markdownToText } from "@helpers/markdown";
import Image from "@components/Image.astro";
const { resource } = Astro.props
const ingredients = resource?.content?.recipeIngredient || [];
const instructions = resource?.content?.recipeInstructions || [];
---
<h1 class="text-4xl">{resource?.content?.name}</h1>
<div>
{resource?.content?.image && <Image hash src={{src: memorium.getImageUrl(resource.content.image)}} alt="Cover for {resource?.content?.name}" class="rounded-2xl overflow-hidden" pictureClass="rounded-2xl" />}
</div>
<p>{resource?.content?.description}</p>
<h2 class="text-2xl">Ingredients</h2>
<ul>
{
ingredients.map((ingredient) => (
<li set:html={markdownToHtml(ingredient)}/>
))
}
</ul>
<h2 class="text-2xl">Steps</h2>
<ol>
{
instructions.map((ingredient) => (
<li set:html={markdownToHtml(ingredient)}/>
))
}
</ol>