From 4844915c25c9cdfb852e41584d93abfd85b82d08 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Fri, 9 Jun 2023 19:18:16 +0200 Subject: Support setting an SVG as a hero image (#185) --- .changeset/silent-feet-think.md | 5 +++++ packages/starlight/components/Hero.astro | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .changeset/silent-feet-think.md diff --git a/.changeset/silent-feet-think.md b/.changeset/silent-feet-think.md new file mode 100644 index 00000000..c521c90e --- /dev/null +++ b/.changeset/silent-feet-think.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Support setting an SVG as the hero image file diff --git a/packages/starlight/components/Hero.astro b/packages/starlight/components/Hero.astro index d16a60e2..a4768622 100644 --- a/packages/starlight/components/Hero.astro +++ b/packages/starlight/components/Hero.astro @@ -14,18 +14,24 @@ const { image, actions, } = Astro.props.hero; + +const imageAttrs = { + loading: 'eager' as const, + decoding: 'async' as const, + width: 400, + height: 400, + alt: image?.alt, +}; ---