mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Fix GitHub badge (#12161)
* Extract component * Remove rounded border form GitHub Stars badge * Add `alt` text
This commit is contained in:
parent
3aa61e615f
commit
7160f7835d
|
@ -195,6 +195,19 @@ const SpaCyVersion = ({ version }) => {
|
|||
))
|
||||
}
|
||||
|
||||
const ImageGitHub = ({ url, isRounded, title }) => (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
style={{
|
||||
borderRadius: isRounded ? '1em' : 0,
|
||||
marginRight: '0.5rem',
|
||||
verticalAlign: 'middle',
|
||||
}}
|
||||
src={`https://img.shields.io/github/${url}`}
|
||||
alt={`${title} on GitHub`}
|
||||
/>
|
||||
)
|
||||
|
||||
const Project = ({ data, components }) => (
|
||||
<>
|
||||
<Title title={data.title || data.id} teaser={data.slogan} image={data.thumb}>
|
||||
|
@ -203,23 +216,20 @@ const Project = ({ data, components }) => (
|
|||
{data.spacy_version && <SpaCyVersion version={data.spacy_version} />}
|
||||
{data.github && (
|
||||
<Link to={`https://github.com/${data.github}`} hidden>
|
||||
{[
|
||||
`release/${data.github}/all.svg?style=flat-square`,
|
||||
`license/${data.github}.svg?style=flat-square`,
|
||||
`stars/${data.github}.svg?style=social&label=Stars`,
|
||||
].map((url, i) => (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
style={{
|
||||
borderRadius: '1em',
|
||||
marginRight: '0.5rem',
|
||||
verticalAlign: 'middle',
|
||||
}}
|
||||
key={i}
|
||||
src={`https://img.shields.io/github/${url}`}
|
||||
alt=""
|
||||
/>
|
||||
))}
|
||||
<ImageGitHub
|
||||
title={data.title || data.id}
|
||||
url={`release/${data.github}/all.svg?style=flat-square`}
|
||||
isRounded
|
||||
/>
|
||||
<ImageGitHub
|
||||
title={data.title || data.id}
|
||||
url={`license/${data.github}.svg?style=flat-square`}
|
||||
isRounded
|
||||
/>
|
||||
<ImageGitHub
|
||||
title={data.title || data.id}
|
||||
url={`stars/${data.github}.svg?style=social&label=Stars`}
|
||||
/>
|
||||
</Link>
|
||||
)}
|
||||
</p>
|
||||
|
|
Loading…
Reference in New Issue
Block a user