WEB-27 Add alt tags to images (#12166)

* Update spaCy badge `alt` text

* Add `next/image` component to Universe

* Add missing `alt`texts
This commit is contained in:
Marcus Blättermann 2023-01-24 13:56:14 +01:00 committed by GitHub
parent c9beb47ab7
commit 031f6c7b60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 14 deletions

View File

@ -134,6 +134,7 @@ useful for your purpose. Here are some important considerations to keep in mind:
<Image <Image
src="/images/sense2vec.jpg" src="/images/sense2vec.jpg"
href="https://github.com/explosion/sense2vec" href="https://github.com/explosion/sense2vec"
alt="sense2vec Screenshot"
/> />
[`sense2vec`](https://github.com/explosion/sense2vec) is a library developed by [`sense2vec`](https://github.com/explosion/sense2vec) is a library developed by

View File

@ -113,6 +113,7 @@ code.
<Image <Image
src="/images/thinc_mypy.jpg" src="/images/thinc_mypy.jpg"
href="https://thinc.ai/docs/usage-type-checking#linting" href="https://thinc.ai/docs/usage-type-checking#linting"
alt="Screenshot of Thinc type checking in VSCode with mypy"
/> />
</Accordion> </Accordion>

View File

@ -943,7 +943,7 @@ full embedded visualizer, as well as individual components.
> $ pip install spacy-streamlit --pre > $ pip install spacy-streamlit --pre
> ``` > ```
![](/images/spacy-streamlit.png) ![Screenshot of the spacy-streamlit package in Streamlit](/images/spacy-streamlit.png)
Using [`spacy-streamlit`](https://github.com/explosion/spacy-streamlit), your Using [`spacy-streamlit`](https://github.com/explosion/spacy-streamlit), your
projects can easily define their own scripts that spin up an interactive projects can easily define their own scripts that spin up an interactive

View File

@ -567,7 +567,10 @@ If you would like to use the spaCy logo on your site, please get in touch and
ask us first. However, if you want to show support and tell others that your ask us first. However, if you want to show support and tell others that your
project is using spaCy, you can grab one of our **spaCy badges** here: project is using spaCy, you can grab one of our **spaCy badges** here:
<img src={`https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg`} /> <img
src={`https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg`}
alt="Built with spaCy"
/>
```markdown ```markdown
[![Built with spaCy](https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg)](https://spacy.io) [![Built with spaCy](https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg)](https://spacy.io)
@ -575,8 +578,9 @@ project is using spaCy, you can grab one of our **spaCy badges** here:
<img <img
src={`https://img.shields.io/badge/made%20with%20❤%20and-spaCy-09a3d5.svg`} src={`https://img.shields.io/badge/made%20with%20❤%20and-spaCy-09a3d5.svg`}
alt="Made with love and spaCy"
/> />
```markdown ```markdown
[![Built with spaCy](https://img.shields.io/badge/made%20with%20❤%20and-spaCy-09a3d5.svg)](https://spacy.io) [![Made with love and spaCy](https://img.shields.io/badge/made%20with%20❤%20and-spaCy-09a3d5.svg)](https://spacy.io)
``` ```

View File

@ -437,6 +437,6 @@ Alternatively, if you're using [Streamlit](https://streamlit.io), check out the
helps you integrate spaCy visualizations into your apps. It includes a full helps you integrate spaCy visualizations into your apps. It includes a full
embedded visualizer, as well as individual components. embedded visualizer, as well as individual components.
![](/images/spacy-streamlit.png) ![Screenshot of the spacy-streamlit package in Streamlit](/images/spacy-streamlit.png)
</Grid> </Grid>

View File

@ -89,8 +89,8 @@ const Landing = () => {
</LandingCard> </LandingCard>
<LandingCard title="Awesome ecosystem" url="/usage/projects" button="Read more"> <LandingCard title="Awesome ecosystem" url="/usage/projects" button="Read more">
Since its release in 2015, spaCy has become an industry standard with Since its release in 2015, spaCy has become an industry standard with a huge
a huge ecosystem. Choose from a variety of plugins, integrate with your machine ecosystem. Choose from a variety of plugins, integrate with your machine
learning stack and build custom components and workflows. learning stack and build custom components and workflows.
</LandingCard> </LandingCard>
</LandingGrid> </LandingGrid>
@ -206,7 +206,10 @@ const Landing = () => {
<LandingGrid cols={2}> <LandingGrid cols={2}>
<LandingCol> <LandingCol>
<Link to="/usage/projects" hidden> <Link to="/usage/projects" hidden>
<ImageFill image={projectsImage} /> <ImageFill
image={projectsImage}
alt="Illustration of project workflow and commands"
/>
</Link> </Link>
<br /> <br />
<br /> <br />

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import classNames from 'classnames' import classNames from 'classnames'
import ImageNext from 'next/image'
import Link from './link' import Link from './link'
import { H5 } from './typography' import { H5 } from './typography'
@ -18,8 +19,7 @@ export default function Card({ title, to, image, header, small, onClick, childre
<H5 className={classes.title}> <H5 className={classes.title}>
{image && ( {image && (
<div className={classes.image}> <div className={classes.image}>
{/* eslint-disable-next-line @next/next/no-img-element */} <ImageNext src={image} height={35} width={35} alt={`${title} Logo`} />
<img src={image} width={35} alt="" />
</div> </div>
)} )}
{title && ( {title && (

View File

@ -51,8 +51,7 @@ export default function Title({
{image && ( {image && (
<div className={classes.image}> <div className={classes.image}>
{/* eslint-disable-next-line @next/next/no-img-element */} <Image src={image} width={100} height={100} alt={`${title} Logo`} />
<img src={image} width={100} height={100} alt="" />
</div> </div>
)} )}
</div> </div>

View File

@ -81,10 +81,11 @@ const UniverseContent = ({ content = [], categories, theme, pageContext, mdxComp
} }
const url = `/universe/project/${id}` const url = `/universe/project/${id}`
const header = youtube && ( const header = youtube && (
// eslint-disable-next-line @next/next/no-img-element <Image
<img
src={`https://img.youtube.com/vi/${youtube}/0.jpg`} src={`https://img.youtube.com/vi/${youtube}/0.jpg`}
alt="" alt={title}
width="480"
height="360"
style={{ style={{
clipPath: 'inset(12.9% 0)', clipPath: 'inset(12.9% 0)',
marginBottom: 'calc(-12.9% + 1rem)', marginBottom: 'calc(-12.9% + 1rem)',