Skip to content

Commit bf3866b

Browse files
committed
feat: use API to fetch sponsors
1 parent 37f43a0 commit bf3866b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/src/components/Hero.astro

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
---
22
import Default from '@astrojs/starlight/components/Hero.astro';
3-
import { Icon } from '@astrojs/starlight/components';
43
import MyIcon from './MyIcon.astro';
54
6-
const sponsors = ['ddotx'];
5+
6+
const sponsorFetch = await fetch('https://ghs.vercel.app/v2/sponsors/tomalaforge');
7+
const { sponsors } = await sponsorFetch.json();
78
---
89

910
<div class="sponsor-header button-hover">
1011
<p>Big thanks to the people supporting this project:
11-
{sponsors.map((sponsor: string) => (
12-
<a href=`https://github.com/${sponsor}`>
12+
{sponsors.past.map(({username, avatar}) => (
13+
<a href=`https://github.com/${username}`>
1314
<img
1415
loading="lazy"
15-
src={`https://github.com/${sponsor}.png?size=80`}
16+
src={avatar}
1617
width="40"
1718
height="40"
18-
alt={sponsor}
19+
alt={username}
1920
class="avatar"
2021
/>
2122
</a>

0 commit comments

Comments
 (0)