11<!-- code adapted from https://github.com/observablehq/plot/blob/main/docs/.vitepress/theme/VersionAndStars.vue -->
22<script setup>
3-
43import {formatPrefix } from " d3-format" ;
54import {data } from " ./stargazers.data" ;
6- const formattedStarCount = data ? formatPrefix (" .1s" , 1000 )(data) : " " ;
75
6+ // Define props with repository URL
7+ const props = defineProps ({
8+ repoUrl: {
9+ type: String ,
10+ default: " https://github.com/JuliaDataCubes/YAXArrays.jl"
11+ }
12+ });
13+
14+ const formattedStarCount = data ? (data < 1000 ? ` ${ data} ` : formatPrefix (" .1s" , 1000 )(data)) : " " ;
815 </script >
916
1017<template >
1118 <a
1219 target =" _blank"
1320 data-decoration =" ★ ; "
14- :title =" data.toLocaleString('en-US').concat(' GitHub stars')"
15- href =" https://github.com/JuliaDataCubes/YAXArrays.jl "
21+ :title =" data ? data .toLocaleString('en-US').concat(' GitHub stars') : '' "
22+ : href =" repoUrl "
1623 >
17- <svg
18- xmlns =" http://www.w3.org/2000/svg"
19- viewBox =" 0 0 24 24"
20- width =" 20"
21- height =" 20"
22- fill =" currentColor"
23- style =" vertical-align : middle ; margin-right : 0.25rem ; margin-left : 0.5rem ;"
24- >
25- <path
26- d =" M12 .297C5.375.297 0 5.673 0 12.3c0 5.292 3.438 9.8 8.207 11.387.6.11.793-.26.793-.577 0-.285-.01-1.04-.015-2.04-3.338.727-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.807 1.305 3.493.997.107-.774.42-1.305.762-1.605-2.665-.3-5.467-1.333-5.467-5.931 0-1.31.47-2.382 1.236-3.222-.123-.303-.535-1.52.117-3.166 0 0 1.01-.323 3.31 1.23.96-.267 1.98-.4 3-.405 1.02.005 2.04.138 3 .405 2.3-1.553 3.31-1.23 3.31-1.23.653 1.646.24 2.863.117 3.166.765.84 1.236 1.912 1.236 3.222 0 4.61-2.807 5.625-5.477 5.921.43.372.823 1.102.823 2.222 0 1.606-.015 2.902-.015 3.293 0 .32.192.693.8.577C20.565 22.1 24 17.588 24 12.297 24 5.673 18.627.297 12 .297z"
27- />
28- </svg >
24+ <svg
25+ xmlns =" http://www.w3.org/2000/svg"
26+ viewBox =" 0 0 24 24"
27+ width =" 20"
28+ height =" 20"
29+ fill =" currentColor"
30+ style =" vertical-align : middle ; margin-right : 0.25rem ; margin-left : 0.5rem ;"
31+ >
32+ <path
33+ d =" M12 .297C5.375.297 0 5.673 0 12.3c0 5.292 3.438 9.8 8.207 11.387.6.11.793-.26.793-.577 0-.285-.01-1.04-.015-2.04-3.338.727-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.807 1.305 3.493.997.107-.774.42-1.305.762-1.605-2.665-.3-5.467-1.333-5.467-5.931 0-1.31.47-2.382 1.236-3.222-.123-.303-.535-1.52.117-3.166 0 0 1.01-.323 3.31 1.23.96-.267 1.98-.4 3-.405 1.02.005 2.04.138 3 .405 2.3-1.553 3.31-1.23 3.31-1.23.653 1.646.24 2.863.117 3.166.765.84 1.236 1.912 1.236 3.222 0 4.61-2.807 5.625-5.477 5.921.43.372.823 1.102.823 2.222 0 1.606-.015 2.902-.015 3.293 0 .32.192.693.8.577C20.565 22.1 24 17.588 24 12.297 24 5.673 18.627.297 12 .297z"
34+ />
35+ </svg >
2936 <span >{{ formattedStarCount }}</span >
3037 </a >
3138 <a
3239 class =" mobile"
3340 target =" _blank"
34- :title =" data.toLocaleString('en-US').concat(' GitHub stars')"
35- href =" https://juliadatacubes.github.io/YAXArrays.jl/stable/ "
41+ :title =" data ? data .toLocaleString('en-US').concat(' GitHub stars') : '' "
42+ : href =" repoUrl "
3643 >
3744 <svg xmlns =" http://www.w3.org/2000/svg" width =" 21" height =" 21" viewBox =" 0 0 21 21" fill =" none" >
3845 <path
@@ -44,7 +51,6 @@ const formattedStarCount = data ? formatPrefix(".1s", 1000)(data) : "";
4451</template >
4552
4653<style scoped>
47-
4854a {
4955 font-size : 14px ;
5056 font-weight : 500 ;
@@ -86,5 +92,4 @@ a.mobile {
8692 display : flex ;
8793 }
8894}
89-
90- </style >
95+ </style >
0 commit comments