generated from autonomic-cooperative/astro-payload-template
Add fallback for img src's
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
523b7c9fd7
commit
0a2dde8009
BIN
astro/public/not-found.png
Normal file
BIN
astro/public/not-found.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
@ -12,7 +12,7 @@ const contentArray = getContentArray(content);
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
src={getImageSrc(value.src)}
|
src={getImageSrc(value.src) || "/not-found.png"}
|
||||||
width={value.width}
|
width={value.width}
|
||||||
height={value.height}
|
height={value.height}
|
||||||
format="webp"
|
format="webp"
|
||||||
|
@ -8,10 +8,10 @@ const { post } = Astro.props;
|
|||||||
href={`/posts/${post.id}/`}
|
href={`/posts/${post.id}/`}
|
||||||
>
|
>
|
||||||
<article class="flex px-5 py-3 gap-8">
|
<article class="flex px-5 py-3 gap-8">
|
||||||
<Image
|
<Image
|
||||||
src={post.thumbnail.url}
|
src={post.thumbnail.url || "/not-found"}
|
||||||
height="150"
|
height={150}
|
||||||
aspectRatio="1"
|
aspectRatio={1}
|
||||||
format="webp"
|
format="webp"
|
||||||
alt={post.thumbnail.alt}
|
alt={post.thumbnail.alt}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user