Skip to content

Commit 51f68f9

Browse files
authored
docs: show vite sponsors (#12621)
1 parent d026a65 commit 51f68f9

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

docs/.vitepress/theme/components/HomeSponsors.vue

+53-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,59 @@ const { data } = useSponsor()
99
<VPHomeSponsors
1010
v-if="data"
1111
message="Vite is free and open source, made possible by wonderful sponsors."
12-
action-text="Become a sponsor"
13-
action-link="https://github.com/sponsors/yyx990803"
1412
:data="data"
1513
/>
14+
<div class="action">
15+
<a
16+
class="sponsor"
17+
href="https://github.com/sponsors/vitejs"
18+
target="_blank"
19+
rel="noreferrer"
20+
>
21+
Sponsor Vite
22+
</a>
23+
<a
24+
class="sponsor"
25+
href="https://github.com/sponsors/yyx990803"
26+
target="_blank"
27+
rel="noreferrer"
28+
>
29+
Sponsor Evan You
30+
</a>
31+
</div>
1632
</template>
33+
34+
<style scoped>
35+
.action {
36+
display: flex;
37+
justify-content: center;
38+
gap: 1rem;
39+
padding-top: 4rem;
40+
}
41+
42+
.sponsor {
43+
/* .VPButton */
44+
display: inline-block;
45+
border: 1px solid transparent;
46+
text-align: center;
47+
font-weight: 600;
48+
white-space: nowrap;
49+
transition: color 0.25s, border-color 0.25s, background-color 0.25s;
50+
/* .VPButton.medium */
51+
border-radius: 20px;
52+
padding: 0 20px;
53+
line-height: 38px;
54+
font-size: 14px;
55+
/* .VPButton.sponsor */
56+
border-color: var(--vp-button-sponsor-border);
57+
color: var(--vp-button-sponsor-text);
58+
background-color: var(--vp-button-sponsor-bg);
59+
}
60+
61+
.sponsor:hover {
62+
/* .VPButton.sponsor:hover */
63+
border-color: var(--vp-button-sponsor-hover-border);
64+
color: var(--vp-button-sponsor-hover-text);
65+
background-color: var(--vp-button-sponsor-hover-bg);
66+
}
67+
</style>

docs/.vitepress/theme/composables/sponsor.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ const data = ref()
2121
const dataHost = 'https://sponsors.vuejs.org'
2222
const dataUrl = `${dataHost}/vite.json`
2323

24+
// no sponsors yet :(
25+
const viteSponsors: Pick<Sponsors, 'gold'> = {
26+
gold: [],
27+
}
28+
2429
export function useSponsor() {
2530
onMounted(async () => {
2631
if (data.value) {
@@ -48,7 +53,7 @@ function mapSponsors(sponsors: Sponsors) {
4853
{
4954
tier: 'Gold Sponsors',
5055
size: 'medium',
51-
items: mapImgPath(sponsors['gold']),
56+
items: viteSponsors['gold'].concat(mapImgPath(sponsors['gold'])),
5257
},
5358
]
5459
}

0 commit comments

Comments
 (0)