fix: remove some type errors
All checks were successful
Deploy to SFTP Server / build (push) Successful in 17m7s
All checks were successful
Deploy to SFTP Server / build (push) Successful in 17m7s
This commit is contained in:
@@ -26,7 +26,9 @@ const t = useTranslations(Astro.url);
|
||||
|
||||
const link = translatePath(`/${collection}/${id.split("/")[0]}`);
|
||||
|
||||
const hasCover = typeof cover === "string" ? !!cover?.length : !!cover?.src;
|
||||
const image = cover as unknown;
|
||||
|
||||
const hasCover = typeof image === "string" ? !!image?.length : !!cover?.src;
|
||||
---
|
||||
|
||||
<Card
|
||||
@@ -64,7 +66,6 @@ const hasCover = typeof cover === "string" ? !!cover?.length : !!cover?.src;
|
||||
<Image
|
||||
hash
|
||||
loader={false}
|
||||
shadow={false}
|
||||
src={cover as ImageMetadata}
|
||||
alt={"cover for " + title}
|
||||
class="right-0 h-full object-cover object-center rounded-none border-l border-neutral"
|
||||
|
||||
@@ -15,11 +15,11 @@ interface Props {
|
||||
thumbnail?: boolean;
|
||||
}
|
||||
|
||||
async function checkImage(image: ImageMetadata) {
|
||||
async function checkImage(image: ImageMetadata):Promise<({height:number,width:number}|undefined)> {
|
||||
const src = typeof image === "string" ? image : image.src;
|
||||
if (!src) return false;
|
||||
if (!src) return ;
|
||||
try {
|
||||
if (src.startsWith("/@fs") || src.startsWith("/_astro")) return true;
|
||||
if (src.startsWith("/@fs") || src.startsWith("/_astro")) return;
|
||||
const res = await inferRemoteSize(src);
|
||||
if (res.format) {
|
||||
image.format = res.format;
|
||||
@@ -27,11 +27,11 @@ async function checkImage(image: ImageMetadata) {
|
||||
} else {
|
||||
console.log("Failed to load: ", src);
|
||||
}
|
||||
return false;
|
||||
return ;
|
||||
} catch (err) {
|
||||
console.log("\n");
|
||||
console.log("Failed to fetch: ", src);
|
||||
return false;
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ const instructions = resource?.content?.recipeInstructions || [];
|
||||
<h2 class="text-2xl px-4">Ingredients</h2>
|
||||
<ul class="list-disc px-10">
|
||||
{
|
||||
ingredients.filter(s => !!s?.length).map((ingredient: string) => (
|
||||
ingredients.filter((s:string) => !!s?.length).map((ingredient: string) => (
|
||||
<li set:html={markdownToHtml(ingredient)} />
|
||||
))
|
||||
}
|
||||
@@ -41,7 +41,7 @@ const instructions = resource?.content?.recipeInstructions || [];
|
||||
<h2 class="text-2xl px-4">Steps</h2>
|
||||
<ol class="list-decimal px-10">
|
||||
{
|
||||
instructions.filter(s => !!s?.length).map((ingredient: string) => (
|
||||
instructions.filter((s:string) => !!s?.length).map((ingredient: string) => (
|
||||
<li set:html={markdownToHtml(ingredient)} />
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user