From 4591c1f5aded7da108f91ff06bd923149e3924b2 Mon Sep 17 00:00:00 2001 From: Michael Stramel Date: Tue, 27 Jul 2021 07:48:14 -0500 Subject: [PATCH] Add an alt tag for the hero image in the blog example (#868) * Add an alt tag for the hero image * pass along * Create heavy-pumas-cross.md --- .changeset/heavy-pumas-cross.md | 5 +++++ examples/blog/src/components/BlogPost.astro | 4 ++-- examples/blog/src/layouts/BlogPost.astro | 4 ++-- examples/blog/src/pages/posts/introducing-astro.md | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/heavy-pumas-cross.md diff --git a/.changeset/heavy-pumas-cross.md b/.changeset/heavy-pumas-cross.md new file mode 100644 index 000000000..5e050e4a6 --- /dev/null +++ b/.changeset/heavy-pumas-cross.md @@ -0,0 +1,5 @@ +--- +"@example/blog": patch +--- + +Add an alt tag for the hero image in the blog example diff --git a/examples/blog/src/components/BlogPost.astro b/examples/blog/src/components/BlogPost.astro index 22fd74645..65eed099d 100644 --- a/examples/blog/src/components/BlogPost.astro +++ b/examples/blog/src/components/BlogPost.astro @@ -8,14 +8,14 @@ export interface Props { heroImage: string; } -const { title, author, publishDate, heroImage } = Astro.props; +const { title, author, publishDate, heroImage, alt } = Astro.props; ---
- {heroImage && } + {heroImage && {alt}}

{publishDate}

{title}

diff --git a/examples/blog/src/layouts/BlogPost.astro b/examples/blog/src/layouts/BlogPost.astro index b27effe54..76cb749d4 100644 --- a/examples/blog/src/layouts/BlogPost.astro +++ b/examples/blog/src/layouts/BlogPost.astro @@ -5,7 +5,7 @@ import BlogHeader from '../components/BlogHeader.astro'; import BlogPost from '../components/BlogPost.astro'; const {content} = Astro.props; -const {title, description, publishDate, author, heroImage, permalink} = content; +const {title, description, publishDate, author, heroImage, permalink, alt} = content; --- @@ -15,7 +15,7 @@ const {title, description, publishDate, author, heroImage, permalink} = content; - + diff --git a/examples/blog/src/pages/posts/introducing-astro.md b/examples/blog/src/pages/posts/introducing-astro.md index 16aa33e38..cf849514b 100644 --- a/examples/blog/src/pages/posts/introducing-astro.md +++ b/examples/blog/src/pages/posts/introducing-astro.md @@ -4,6 +4,7 @@ description: "We're excited to announce Astro as a new way to build static websi publishDate: 'Tuesday, June 8 2021' author: 'fred' heroImage: '/social.jpg' +alt: 'Astro' layout: '../../layouts/BlogPost.astro' ---