Skip to content

Commit bd2a9b9

Browse files
authored
docs: add special sponsors section (vitejs#1002)
1 parent eb14b51 commit bd2a9b9

File tree

6 files changed

+427
-367
lines changed

6 files changed

+427
-367
lines changed

.vitepress/theme/composables/sponsor.ts

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,27 @@ 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'> = {
24+
const viteSponsors: Pick<Sponsors, 'special' | 'gold'> = {
25+
special: [
26+
// sponsors patak-dev
27+
{
28+
name: 'StackBlitz',
29+
url: 'https://stackblitz.com',
30+
img: '/stackblitz.svg',
31+
},
32+
// sponsors antfu
33+
{
34+
name: 'NuxtLabs',
35+
url: 'https://nuxtlabs.com',
36+
img: '/nuxtlabs.svg',
37+
},
38+
// sponsors bluwy
39+
{
40+
name: 'Astro',
41+
url: 'https://astro.build',
42+
img: '/astro.svg',
43+
},
44+
],
2645
gold: [],
2746
}
2847

@@ -46,7 +65,12 @@ export function useSponsor() {
4665
function mapSponsors(sponsors: Sponsors) {
4766
return [
4867
{
49-
tier: 'Platinum Sponsor',
68+
tier: 'Special Sponsors',
69+
size: 'big',
70+
items: viteSponsors['special'],
71+
},
72+
{
73+
tier: 'Platinum Sponsors',
5074
size: 'big',
5175
items: mapImgPath(sponsors['platinum']),
5276
},
@@ -58,9 +82,20 @@ function mapSponsors(sponsors: Sponsors) {
5882
]
5983
}
6084

85+
const viteSponsorNames = new Set(
86+
Object.values(viteSponsors).flatMap((sponsors) =>
87+
sponsors.map((s) => s.name),
88+
),
89+
)
90+
91+
/**
92+
* Map Vue/Vite sponsors data to objects and filter out Vite-specific sponsors
93+
*/
6194
function mapImgPath(sponsors: Sponsor[]) {
62-
return sponsors.map((sponsor) => ({
63-
...sponsor,
64-
img: `${dataHost}/images/${sponsor.img}`,
65-
}))
95+
return sponsors
96+
.filter((sponsor) => !viteSponsorNames.has(sponsor.name))
97+
.map((sponsor) => ({
98+
...sponsor,
99+
img: `${dataHost}/images/${sponsor.img}`,
100+
}))
66101
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"textlint": "^12.0.2",
1414
"textlint-filter-rule-allowlist": "^4.0.0",
1515
"textlint-rule-preset-vuejs-jp": "git+https://github.com/vuejs-jp/textlint-rule-preset-vuejs-jp.git",
16-
"vitepress": "^1.0.0-alpha.40",
16+
"vitepress": "1.0.0-beta.1",
1717
"yorkie": "^2.0.0"
1818
},
1919
"gitHooks": {

public/astro.svg

Lines changed: 1 addition & 0 deletions
Loading

public/nuxtlabs.svg

Lines changed: 1 addition & 0 deletions
Loading

public/stackblitz.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)