Skip to content

Commit 7099360

Browse files
committed
add image_alt field to column image template
Column images in the page builder had no alt text support, causing critical image-alt a11y violations on pages using them.
1 parent e37432d commit 7099360

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/ColumnContent.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const BlockTypes = {
2323
2424
---
2525
{ item.__typename.endsWith(BlockTypes.image) && (
26-
<img src={item.image} class={clsx(
26+
<img src={item.image} alt={item.image_alt || ''} class={clsx(
2727
'w-full object-cover',
2828
{ 'h-full': item.full_height },
2929
{ 'rounded-md': item.rounded }

tina/content/pages.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ const staticSectionTemplates: Template<false>[] = [{
512512
name: 'image',
513513
label: 'Image',
514514
type: 'image'
515+
}, {
516+
name: 'image_alt',
517+
label: 'Image Alt Text',
518+
type: 'string'
515519
}, {
516520
name: 'full_height',
517521
label: 'Full height?',

0 commit comments

Comments
 (0)