diff --git a/src/components/Detail/ImageCarousel.astro b/src/components/Detail/ImageCarousel.astro index 08a68d8..e7f09d2 100644 --- a/src/components/Detail/ImageCarousel.astro +++ b/src/components/Detail/ImageCarousel.astro @@ -21,6 +21,14 @@ const links = await Promise.all( const links = dataElement ? JSON.parse(dataElement.textContent || '[]') : []; const cap = links.length - 1; const img = document.getElementById('carousel-img') as HTMLImageElement; + + if (cap == 0) { + const b0 = document.getElementById('dec-button') + const b1 = document.getElementById('inc-button') + + b0.hidden = true + b1.hidden = true + } function inc() { pos = pos === cap ? 0 : pos + 1; @@ -41,7 +49,10 @@ const links = await Promise.all( - - - +
+ + + + +
\ No newline at end of file diff --git a/src/pages/recipe/[recipeid].astro b/src/pages/recipe/[recipeid].astro index 0acb44a..4b0c6fc 100644 --- a/src/pages/recipe/[recipeid].astro +++ b/src/pages/recipe/[recipeid].astro @@ -7,10 +7,24 @@ const { recipeid } = Astro.params; const re = await client.collection("recipes").getOne(recipeid ?? "0"); +const stepIds = re.steps + +const steps = await Promise.all( + stepIds.map(async s => + await client.collection("steps").getOne(s) + ) +) + ---
+ +
+

{re.name}

+ + {steps.map(a => (

{a.instruction}

))} +
\ No newline at end of file