Add alt tags to images for a11y (#529)

- Add imageAlt to GridBlock
- Set alt equal to `user.caption` for mapped users
- Set alt equal to `post.author` for blog posts
- Update documentation
This commit is contained in:
Amy Lam 2018-04-07 19:13:12 -07:00 committed by Joel Marcey
parent fc6e3b7311
commit c2cd169b64
10 changed files with 33 additions and 18 deletions

View file

@ -64,6 +64,7 @@ The `contents` attribute is an array containing the contents of each section of
- `imageAlign` field for image alignment relative to the text, which defaults to `top` and can be set to `bottom`, `left`, or `right`
- `title` for the title to display for this section, which is parsed from markdown
- `imageLink` for a link destination from clicking the image
- `imageAlt` for the description of what text will be shown in case the image is not available
Example:
@ -75,7 +76,8 @@ Example:
content: "Learn how to use this project",
image: siteConfig.baseUrl + "img/learn.png",
title: `[Learn](${siteConfig.baseUrl}docs/tutorial.html)`,
imageLink: siteConfig.baseUrl + "docs/tutorial.html"
imageLink: siteConfig.baseUrl + "docs/tutorial.html",
imageAlt: "Learn how to use this project"
},
{
content: "Questions gathered from the community",