From 1f5d88fec182d7c138ce4a0a6c366301237fd152 Mon Sep 17 00:00:00 2001 From: Ciffelia Date: Tue, 5 Dec 2023 19:27:42 +0900 Subject: [PATCH] =?UTF-8?q?``=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=E3=81=ABSVG=E3=81=8C=E4=B8=8E?= =?UTF-8?q?=E3=81=88=E3=82=89=E3=82=8C=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AF?= =?UTF-8?q?srcset=E3=82=92=E7=94=9F=E6=88=90=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Image.astro | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/common/Image.astro b/src/components/common/Image.astro index cbdd59f..7819f4f 100644 --- a/src/components/common/Image.astro +++ b/src/components/common/Image.astro @@ -10,7 +10,7 @@ type Props = Omit, 'src' | 'srcset'> & { const { widths = [3840, 1920, 960, 480, 240], ...attrs } = Astro.props -const { src, attributes } = await getImage(attrs) +const { src, options, attributes } = await getImage(attrs) const originalWidth = parseInt(attributes.width, 10) const srcset = ( @@ -25,4 +25,14 @@ const srcset = ( ).join(',') --- - +{ + options.format === 'svg' ? ( + + ) : ( + + ) +}