fix: some stuff
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import type { ImageMetadata } from "astro";
|
||||
import { Picture as AstroImage } from "astro:assets";
|
||||
import { inferRemoteSize } from "astro/assets/utils";
|
||||
import { generateThumbHash, getImageBuffer, getExifData } from "@helpers/image";
|
||||
import { getProcessedImage } from "@helpers/image";
|
||||
interface Props {
|
||||
src: ImageMetadata & { fsPath?: string; src?: string };
|
||||
alt: string;
|
||||
@@ -45,12 +45,11 @@ const {
|
||||
thumbnail = false,
|
||||
} = Astro.props;
|
||||
|
||||
|
||||
|
||||
const imageOk = await checkImage(image);
|
||||
const imageBuffer = imageOk && (await getImageBuffer(image));
|
||||
let thumbhash = imageBuffer && (await generateThumbHash(imageBuffer));
|
||||
let exif = imageBuffer && (await getExifData(imageBuffer));
|
||||
|
||||
const { thumbhash, exif } = imageOk
|
||||
? await getProcessedImage(image)
|
||||
: { thumbhash: undefined, exif: undefined };
|
||||
|
||||
const definedSizes = [
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ const instructions = resource?.content?.recipeInstructions || [];
|
||||
<h2 class="text-2xl">Ingredients</h2>
|
||||
<ul>
|
||||
{
|
||||
ingredients.map((ingredient) => (
|
||||
ingredients.map((ingredient: string) => (
|
||||
<li set:html={markdownToHtml(ingredient)}/>
|
||||
))
|
||||
}
|
||||
@@ -26,7 +26,7 @@ const instructions = resource?.content?.recipeInstructions || [];
|
||||
<h2 class="text-2xl">Steps</h2>
|
||||
<ol>
|
||||
{
|
||||
instructions.map((ingredient) => (
|
||||
instructions.map((ingredient: string) => (
|
||||
<li set:html={markdownToHtml(ingredient)}/>
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user