File tree Expand file tree Collapse file tree 4 files changed +39
-33
lines changed Expand file tree Collapse file tree 4 files changed +39
-33
lines changed Original file line number Diff line number Diff line change 4
4
"repoType" : " github" ,
5
5
"repoHost" : " https://github.com" ,
6
6
"files" : [
7
- " README.md" ,
8
- " src/components/Contributors.mdx"
7
+ " README.md"
9
8
],
10
9
"contributors" : [
11
10
{
Original file line number Diff line number Diff line change 1
- import Contributors from " @/components/Contributors.mdx "
1
+ import Contributors from " @/components/Contributors.tsx "
2
2
3
3
export const metadata = {
4
4
title: ' 贡献者' ,
@@ -7,18 +7,6 @@ export const metadata = {
7
7
# 贡献者
8
8
9
9
10
- * <Authors names = " ciaochaos" />
11
-
12
- `` Catalyst ``
13
-
14
- * <Authors names = " shichen" />
15
-
16
- `` Conjurer ``
17
-
18
- * <Authors names = " cpunisher" />
19
-
20
- `` Engineer ``
21
-
22
10
<div className = " prose-img:m-0" >
23
11
<Contributors />
24
12
</div >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments