Skip to content

Commit 5ce44f1

Browse files
committed
Replace last use of eleventy-fetch
1 parent f86f5f1 commit 5ce44f1

File tree

5 files changed

+13
-120
lines changed

5 files changed

+13
-120
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"lunaria:build": "tsm ./scripts/lunaria.mts"
2424
},
2525
"devDependencies": {
26-
"@11ty/eleventy-fetch": "^5.1.0",
2726
"@actions/core": "^1.11.1",
2827
"@docsearch/css": "3.5.1",
2928
"@docsearch/js": "3.5.1",

pnpm-lock.yaml

Lines changed: 0 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/starlight/Hero/FacePile.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import { Image } from 'astro:assets';
3-
import { cachedFetch } from '~/util/cachedFetch';
3+
import { getCollection } from 'astro:content';
44
55
export interface Props {
66
tagline: string;
@@ -14,8 +14,9 @@ type Contributor = {
1414
avatar_url: string;
1515
};
1616
17-
const res = await cachedFetch('https://astro.badg.es/api/v1/top-contributors.json');
18-
const allContributors: Contributor[] = (await res.json()).data;
17+
const allContributors: Contributor[] = (await getCollection('astroContributors')).map(
18+
({ data }) => data
19+
);
1920
2021
const arrangement = [3, 4, 3, 3, 6, 4, 6, 3, 3, 3];
2122
const circles = [1, 0, 2, 2, -1, 2, -1, -1, 3, -1];

src/content.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,13 @@ export const collections = {
181181
},
182182
schema: z.object({ version: z.string() }),
183183
}),
184+
astroContributors: defineCollection({
185+
loader: async () => {
186+
const { data } = await fetch('https://astro.badg.es/api/v1/top-contributors.json').then(
187+
(res) => res.json()
188+
);
189+
return data.map((contributor: any) => ({ id: contributor.username, ...contributor }));
190+
},
191+
schema: z.object({ avatar_url: z.string() }),
192+
}),
184193
};

src/util/cachedFetch.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)