mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +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 }) => (
|
const Project = ({ data, components }) => (
|
||||||
<>
|
<>
|
||||||
<Title title={data.title || data.id} teaser={data.slogan} image={data.thumb}>
|
<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.spacy_version && <SpaCyVersion version={data.spacy_version} />}
|
||||||
{data.github && (
|
{data.github && (
|
||||||
<Link to={`https://github.com/${data.github}`} hidden>
|
<Link to={`https://github.com/${data.github}`} hidden>
|
||||||
{[
|
<ImageGitHub
|
||||||
`release/${data.github}/all.svg?style=flat-square`,
|
title={data.title || data.id}
|
||||||
`license/${data.github}.svg?style=flat-square`,
|
url={`release/${data.github}/all.svg?style=flat-square`}
|
||||||
`stars/${data.github}.svg?style=social&label=Stars`,
|
isRounded
|
||||||
].map((url, i) => (
|
/>
|
||||||
// eslint-disable-next-line @next/next/no-img-element
|
<ImageGitHub
|
||||||
<img
|
title={data.title || data.id}
|
||||||
style={{
|
url={`license/${data.github}.svg?style=flat-square`}
|
||||||
borderRadius: '1em',
|
isRounded
|
||||||
marginRight: '0.5rem',
|
/>
|
||||||
verticalAlign: 'middle',
|
<ImageGitHub
|
||||||
}}
|
title={data.title || data.id}
|
||||||
key={i}
|
url={`stars/${data.github}.svg?style=social&label=Stars`}
|
||||||
src={`https://img.shields.io/github/${url}`}
|
/>
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user