Skip to content

Commit a89163c

Browse files
committed
update
1 parent 27391bf commit a89163c

File tree

4 files changed

+39
-33
lines changed

4 files changed

+39
-33
lines changed

.all-contributorsrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"repoType": "github",
55
"repoHost": "https://github.com",
66
"files": [
7-
"README.md",
8-
"src/components/Contributors.mdx"
7+
"README.md"
98
],
109
"contributors": [
1110
{

src/app/preface/contributors/page.mdx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Contributors from "@/components/Contributors.mdx"
1+
import Contributors from "@/components/Contributors.tsx"
22

33
export const metadata = {
44
title: '贡献者',
@@ -7,18 +7,6 @@ export const metadata = {
77
# 贡献者
88

99

10-
* <Authors names="ciaochaos" />
11-
12-
``Catalyst``
13-
14-
* <Authors names="shichen" />
15-
16-
``Conjurer``
17-
18-
* <Authors names="cpunisher" />
19-
20-
``Engineer``
21-
2210
<div className="prose-img:m-0">
2311
<Contributors />
2412
</div>

src/components/Contributors.mdx

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

src/components/Contributors.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
3+
import { promises as fs } from 'fs';
4+
5+
interface Contributor {
6+
login: string
7+
name: string
8+
avatar_url: string
9+
profile: string
10+
contributions: string[]
11+
}
12+
13+
export default async function Contributors() {
14+
const file = await fs.readFile(process.cwd() + '/.all-contributorsrc', 'utf8');
15+
const data = JSON.parse(file);
16+
const contributors: Contributor[] = data["contributors"]
17+
18+
return (
19+
<div className="flex flex-wrap gap-6 ">
20+
{contributors.map((contributor) => (
21+
<div key={contributor.login} className="flex flex-col items-center _grow">
22+
<a href={contributor.profile} className="flex flex-col items-center grow-0 w-20">
23+
<img
24+
src={contributor.avatar_url}
25+
width="w-20 h-20"
26+
alt={contributor.name}
27+
className="rounded-full"
28+
/>
29+
<div className="mt-2 text-xs line-clamp-1 w-full text-center">
30+
<b>{contributor.name}</b>
31+
</div>
32+
</a>
33+
</div>
34+
))}
35+
</div>
36+
);
37+
}

0 commit comments

Comments
 (0)