Commit 1ff2acf 1 parent f9d153f commit 1ff2acf Copy full SHA for 1ff2acf
File tree 4 files changed +60
-7
lines changed
4 files changed +60
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"gpt-context-generator.detectedFileExtensions" : [
3
- " js" ,
4
- " jsx" ,
5
- " ts" ,
6
- " tsx" ,
7
- " mdx" ,
8
3
" json" ,
9
4
" swift" ,
10
5
" plist" ,
11
6
" pbxproj" ,
12
7
" entitlements" ,
13
8
" md" ,
14
9
" yml" ,
15
- " html"
10
+ " html" ,
11
+ " astro" ,
12
+ " ts" ,
13
+ " mjs" ,
14
+ " scss" ,
15
+ " CNAME" ,
16
+ " Dockerfile"
16
17
],
17
18
"markdownlint.config" : {
18
19
"default" : true ,
Original file line number Diff line number Diff line change
1
+ ---
2
+ // docs/src/components/GithubStars.astro
3
+ const REPO = " codybrom/blankie" ;
4
+
5
+ async function getStarCount() {
6
+ try {
7
+ const response = await fetch (` https://api.github.com/repos/${REPO } ` );
8
+ const data = await response .json ();
9
+ return data .stargazers_count ;
10
+ } catch (error ) {
11
+ console .error (" Error fetching GitHub stars:" , error );
12
+ return null ;
13
+ }
14
+ }
15
+
16
+ const stars = await getStarCount ();
17
+ ---
18
+
19
+ <a
20
+ href ={ ` https://github.com/${REPO } ` }
21
+ target =" _blank"
22
+ rel =" noopener noreferrer"
23
+ class =" inline-flex items-center text-sm group"
24
+ title =" Star us on GitHub"
25
+ >
26
+ <span
27
+ class =" inline-flex items-center gap-1.5 px-3 py-1 font-medium bg-[#f6f8fa] border border-[#1b1f2426] rounded-l-md hover:bg-[#f3f4f6] text-[#24292f] dark:bg-[#21262d] dark:border-[#f0f6fc1a] dark:text-[#c9d1d9] dark:hover:bg-[#30363d] transition-colors duration-200"
28
+ >
29
+ <svg
30
+ viewBox =" 0 0 16 16"
31
+ width =" 16"
32
+ height =" 16"
33
+ class =" inline-block fill-current"
34
+ aria-hidden =" true"
35
+ >
36
+ <path
37
+ d =" M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z"
38
+ ></path >
39
+ </svg >
40
+ <span >Github Stars</span >
41
+ </span >
42
+ {
43
+ stars !== null && (
44
+ <span class = " inline-flex items-center px-3 py-1 font-medium bg-[#f6f8fa] border border-l-0 border-[#1b1f2426] rounded-r-md hover:bg-[#f3f4f6] text-[#24292f] dark:bg-[#21262d] dark:border-[#f0f6fc1a] dark:text-[#c9d1d9] dark:hover:bg-[#30363d] transition-colors duration-200" >
45
+ { new Intl .NumberFormat (" en-US" ).format (stars )}
46
+ </span >
47
+ )
48
+ }
49
+ </a >
Original file line number Diff line number Diff line change 1
1
---
2
2
import { Image } from " astro:assets" ;
3
3
import icon from " ../assets/icon.png" ;
4
+ import GithubStars from " ./GithubStars.astro" ;
4
5
const currentPath = Astro .url .pathname ;
5
6
---
6
7
@@ -82,6 +83,7 @@ const currentPath = Astro.url.pathname;
82
83
>
83
84
Credits
84
85
</a >
86
+ <GithubStars />
85
87
<a
86
88
href =" /?section=download"
87
89
class =" bg-primary-blue text-white py-2 px-6 rounded-full text-sm font-normal transition-all duration-300 hover:bg-deep-blue no-underline"
@@ -121,6 +123,7 @@ const currentPath = Astro.url.pathname;
121
123
>
122
124
Credits
123
125
</a >
126
+ <GithubStars />
124
127
<a
125
128
href =" /?section=download"
126
129
class =" bg-primary-blue text-white py-2 px-6 rounded-full text-sm font-normal transition-all duration-300 hover:bg-deep-blue no-underline inline-block text-center"
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const description = "Ambient sound mixer for macOS.";
27
27
28
28
<meta
29
29
http-equiv =" Content-Security-Policy"
30
- content =" default-src 'self'; img-src 'self' data: https:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';"
30
+ content =" default-src 'self'; img-src 'self' data: https:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' api.github.com; "
31
31
/>
32
32
33
33
<link rel =" icon" type =" image/x-icon" href ={ favicon } />
You can’t perform that action at this time.
0 commit comments