Skip to content

Commit 6f14d3e

Browse files
committed
theme: workaround adblock for sponsors
1 parent 7119fae commit 6f14d3e

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

.vitepress/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ export default defineConfigWithTheme<ThemeConfig>({
608608
'link',
609609
{
610610
rel: 'preconnect',
611-
href: 'https://sponsors.vuejs.org'
611+
href: 'https://automation.vuejs.org'
612612
}
613613
],
614614
[

.vitepress/theme/components/Home.vue

+15-15
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ onMounted(load)
5353
</p>
5454
</section>
5555

56-
<section v-if="data && data.special" id="special-sponsor">
56+
<section v-if="data && data.special" id="special-spsr">
5757
<span class="lead">Special Sponsor</span>
5858
<template v-for="{ url, img, name, description } of data.special">
5959
<a :href="url" target="_blank" rel="sponsored noopener">
@@ -75,7 +75,7 @@ onMounted(load)
7575
<span>{{ description }}</span>
7676
</template>
7777
</section>
78-
<section v-else id="special-sponsor">
78+
<section v-else id="special-spsr">
7979
<span>
8080
<a href="/sponsor/#tier-benefits">
8181
Special Sponsor slot is now vacant - Inquire now
@@ -107,7 +107,7 @@ onMounted(load)
107107
</div>
108108
</section>
109109

110-
<section id="sponsors">
110+
<section id="spsrs">
111111
<h2>Platinum Sponsors</h2>
112112
<SponsorsGroup tier="platinum" placement="landing" />
113113
<h2>Gold Sponsors</h2>
@@ -227,38 +227,38 @@ html:not(.dark) .accent,
227227
background-color: var(--vt-c-gray-dark-3);
228228
}
229229
230-
#special-sponsor {
230+
#special-spsr {
231231
border-top: 1px solid var(--vt-c-divider-light);
232232
border-bottom: 1px solid var(--vt-c-divider-light);
233233
padding: 12px 24px;
234234
display: flex;
235235
align-items: center;
236236
}
237237
238-
#special-sponsor span {
238+
#special-spsr span {
239239
color: var(--vt-c-text-2);
240240
font-weight: 500;
241241
font-size: 13px;
242242
vertical-align: middle;
243243
flex: 1;
244244
}
245245
246-
#special-sponsor span:first-child {
246+
#special-spsr span:first-child {
247247
text-align: right;
248248
}
249249
250-
#special-sponsor a {
250+
#special-spsr a {
251251
display: flex;
252252
justify-content: center;
253253
padding: 0 24px;
254254
}
255255
256-
#special-sponsor img {
256+
#special-spsr img {
257257
height: 42px;
258258
margin: -6px 0;
259259
}
260260
261-
.dark #special-sponsor img {
261+
.dark #special-spsr img {
262262
filter: grayscale(1) invert(1);
263263
}
264264
@@ -286,18 +286,18 @@ html:not(.dark) .accent,
286286
background-color: transparent;
287287
}
288288
289-
#sponsors {
289+
#spsrs {
290290
max-width: 900px;
291291
margin: 0px auto;
292292
}
293293
294-
#sponsors h2 {
294+
#spsrs h2 {
295295
font-size: 20px;
296296
font-weight: 600;
297297
margin-bottom: 1em;
298298
}
299299
300-
#sponsors .sponsor-container {
300+
#spsrs .spsr-container {
301301
margin-bottom: 3em;
302302
}
303303
@@ -330,14 +330,14 @@ html:not(.dark) .accent,
330330
font-size: 16px;
331331
margin: 18px 0 30px;
332332
}
333-
#special-sponsor {
333+
#special-spsr {
334334
flex-direction: column;
335335
}
336-
#special-sponsor img {
336+
#special-spsr img {
337337
height: 36px;
338338
margin: 8px 0;
339339
}
340-
#special-sponsor span {
340+
#special-spsr span {
341341
text-align: center !important;
342342
}
343343
#highlights h3 {

.vitepress/theme/components/SponsorsGroup.vue

+35-35
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ function resolveList(data: SponsorData) {
6666
<template>
6767
<div
6868
ref="container"
69-
class="sponsor-container"
69+
class="spsr-container"
7070
:class="[tier.startsWith('plat') ? 'platinum' : tier, placement]"
7171
>
7272
<template v-if="data && visible">
7373
<a
7474
v-for="{ url, img, name } of resolveList(data)"
75-
class="sponsor-item"
75+
class="spsr-item"
7676
:href="url"
7777
target="_blank"
7878
rel="sponsored noopener"
@@ -91,39 +91,39 @@ function resolveList(data: SponsorData) {
9191
<a
9292
v-if="placement !== 'page' && tier !== 'special'"
9393
href="/sponsor/"
94-
class="sponsor-item action"
94+
class="spsr-item action"
9595
@click="track(true)"
9696
>Become a Sponsor</a
9797
>
9898
<a
9999
v-if="tier === 'special' && data && !data[tier]?.length"
100100
href="/sponsor/#tier-benefits"
101-
class="sponsor-item action"
101+
class="spsr-item action"
102102
@click="track(true)"
103103
>Inquire about Special Sponsorship</a
104104
>
105105
</div>
106106
</template>
107107

108108
<style scoped>
109-
.sponsor-container {
109+
.spsr-container {
110110
--max-width: 100%;
111111
display: grid;
112112
grid-template-columns: repeat(auto-fill, minmax(var(--max-width), 1fr));
113113
column-gap: 4px;
114114
}
115115
116-
.sponsor-container.platinum {
116+
.spsr-container.platinum {
117117
--max-width: 240px;
118118
}
119-
.sponsor-container.gold {
119+
.spsr-container.gold {
120120
--max-width: 180px;
121121
}
122-
.sponsor-container.silver {
122+
.spsr-container.silver {
123123
--max-width: 140px;
124124
}
125125
126-
.sponsor-item {
126+
.spsr-item {
127127
margin: 2px 0;
128128
background-color: var(--vt-c-white-soft);
129129
display: flex;
@@ -133,92 +133,92 @@ function resolveList(data: SponsorData) {
133133
transition: background-color 0.2s ease;
134134
height: calc(var(--max-width) / 2 - 6px);
135135
}
136-
.sponsor-item.action {
136+
.spsr-item.action {
137137
font-size: 11px;
138138
color: var(--vt-c-text-3);
139139
}
140-
.sponsor-container.page .sponsor-item.action {
140+
.spsr-container.page .spsr-item.action {
141141
font-size: 16px;
142142
}
143-
.sponsor-item img {
143+
.spsr-item img {
144144
max-width: calc(var(--max-width) - 30px);
145145
max-height: calc(var(--max-width) / 2 - 20px);
146146
}
147-
.special .sponsor-item {
147+
.special .spsr-item {
148148
height: 160px;
149149
}
150-
.special .sponsor-item img {
150+
.special .spsr-item img {
151151
max-width: 300px;
152152
max-height: 150px;
153153
}
154154
155155
/* dark mode */
156-
.dark .aside .sponsor-item,
157-
.dark .landing .sponsor-item {
156+
.dark .aside .spsr-item,
157+
.dark .landing .spsr-item {
158158
background-color: var(--vt-c-bg-soft);
159159
}
160-
.aside .sponsor-item img,
161-
.landing .sponsor-item img {
160+
.aside .spsr-item img,
161+
.landing .spsr-item img {
162162
transition: filter 0.2s ease;
163163
}
164-
.dark .aside .sponsor-item img,
165-
.dark .landing .sponsor-item img {
164+
.dark .aside .spsr-item img,
165+
.dark .landing .spsr-item img {
166166
filter: grayscale(1) invert(1);
167167
}
168-
.dark .aside .sponsor-item:hover,
169-
.dark .landing .sponsor-item:hover {
168+
.dark .aside .spsr-item:hover,
169+
.dark .landing .spsr-item:hover {
170170
color: var(--vt-c-indigo);
171171
background-color: var(--vt-c-white-mute);
172172
}
173-
.dark .sponsor-item:hover img {
173+
.dark .spsr-item:hover img {
174174
filter: none;
175175
}
176176
177177
/* aside mode (on content pages) */
178-
.sponsor-container.platinum.aside {
178+
.spsr-container.platinum.aside {
179179
--max-width: 110px;
180180
column-gap: 1px;
181181
}
182-
.aside .sponsor-item {
182+
.aside .spsr-item {
183183
margin: 1px 0;
184184
}
185-
.aside .special .sponsor-item {
185+
.aside .special .spsr-item {
186186
width: 100%;
187187
height: 60px;
188188
}
189-
.aside .special .sponsor-item img {
189+
.aside .special .spsr-item img {
190190
max-width: 120px;
191191
max-height: 48px;
192192
}
193-
.aside .platinum .sponsor-item {
193+
.aside .platinum .spsr-item {
194194
width: 111px;
195195
height: 50px;
196196
}
197-
.aside .platinum .sponsor-item img {
197+
.aside .platinum .spsr-item img {
198198
max-width: 88px;
199199
}
200200
201201
/* narrow, aside will be hidden under this state so it's mutually exclusive */
202202
@media (max-width: 720px) {
203-
.sponsor-container.platinum {
203+
.spsr-container.platinum {
204204
--max-width: 180px;
205205
}
206-
.sponsor-container.gold {
206+
.spsr-container.gold {
207207
--max-width: 140px;
208208
}
209-
.sponsor-container.silver {
209+
.spsr-container.silver {
210210
--max-width: 120px;
211211
}
212212
}
213213
214214
@media (max-width: 480px) {
215-
.sponsor-container.platinum {
215+
.spsr-container.platinum {
216216
--max-width: 150px;
217217
}
218-
.sponsor-container.gold {
218+
.spsr-container.gold {
219219
--max-width: 120px;
220220
}
221-
.sponsor-container.silver {
221+
.spsr-container.silver {
222222
--max-width: 100px;
223223
}
224224
}

.vitepress/theme/components/sponsors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface SponsorData {
2828
export const data = ref<SponsorData>()
2929
export const pending = ref<boolean>(false)
3030

31-
export const base = `https://sponsors.vuejs.org`
31+
export const base = `https://automation.vuejs.org`
3232

3333
export const load = async () => {
3434
if (!pending.value) {

0 commit comments

Comments
 (0)