@@ -6,23 +6,23 @@ import Page from '../components/Page.astro';
6
6
7
7
import ' ../styles/global.css' ;
8
8
9
- // const token = import.meta.env.GITHUB_TOKEN;
10
- // const githubRepos = await fetch('https://api.github.com/users/auguwu/repos', {
11
- // headers:
12
- // token !== undefined
13
- // ? {
14
- // Authorization: `token ${token}`
15
- // }
16
- // : {}
17
- // })
18
- // .then((res) => res.json())
19
- // .then((data: any[]) =>
20
- // data
21
- // .sort((a, b) => b.stargazers_count - a.stargazers_count)
22
- // .filter((s) => !s.archived)
23
- // .filter((s) => s.name !== 'auguwu')
24
- // .slice(0, 6)
25
- // );
9
+ const token = import .meta .env .GITHUB_TOKEN ;
10
+ const githubRepos = await fetch (' https://api.github.com/users/auguwu/repos' , {
11
+ headers:
12
+ token !== undefined
13
+ ? {
14
+ Authorization: ` token ${token } `
15
+ }
16
+ : {}
17
+ })
18
+ .then ((res ) => res .json ())
19
+ .then ((data : any []) =>
20
+ data
21
+ .sort ((a , b ) => b .stargazers_count - a .stargazers_count )
22
+ .filter ((s ) => ! s .archived )
23
+ .filter ((s ) => s .name !== ' auguwu' )
24
+ .slice (0 , 6 )
25
+ );
26
26
---
27
27
28
28
<Page
@@ -62,7 +62,7 @@ import '../styles/global.css';
62
62
</a >
63
63
</div >
64
64
65
- <!-- < div class="flex container mx-auto mt-6 items-center justify-center lg:hidden">
65
+ <div class =" flex container mx-auto mt-6 items-center justify-center lg:hidden" >
66
66
<div class =" grid grid-cols-1 gap-6 [&>*]:h-full" >
67
67
{ githubRepos .map ((data ) => <ProjectCard data = { data } />)}
68
68
</div >
@@ -72,6 +72,6 @@ import '../styles/global.css';
72
72
<div class =" grid grid-cols-3 gap-3 items-center [&>*]:h-full" >
73
73
{ githubRepos .map ((data ) => <ProjectCard data = { data } />)}
74
74
</div >
75
- </div> -->
75
+ </div >
76
76
</Container >
77
77
</Page >
0 commit comments