Skip to content

Commit b99bfea

Browse files
authored
Merge pull request #1082 from KiritaniAyaka/sync
Sync #7d7d50ed
2 parents 1543ad8 + 6d397af commit b99bfea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+399
-520
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ dist/
9898
# vitepress build output
9999
.vitepress/dist
100100
.vitepress/cache
101+
.vitepress/.temp
101102

102103
# Serverless directories
103104
.serverless/

.vitepress/config.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'fs'
22
import path from 'path'
3-
import { defineConfigWithTheme, type Plugin } from 'vitepress'
3+
import { defineConfigWithTheme, type HeadConfig, type Plugin } from 'vitepress'
44
import type { Config as ThemeConfig } from '@vue/theme'
55
import llmstxt from 'vitepress-plugin-llms'
66
import baseConfig from '@vue/theme/config'
@@ -497,10 +497,6 @@ export const sidebar: ThemeConfig['sidebar'] = {
497497
text: '带过渡动效的列表',
498498
link: '/examples/#list-transition'
499499
},
500-
{
501-
text: 'TodoMVC',
502-
link: '/examples/#todomvc'
503-
}
504500
]
505501
},
506502
{
@@ -601,6 +597,17 @@ const i18n: ThemeConfig['i18n'] = {
601597
ariaSidebarNav: '侧边栏导航'
602598
}
603599

600+
function inlineScript(file: string): HeadConfig {
601+
return [
602+
'script',
603+
{},
604+
fs.readFileSync(
605+
path.resolve(__dirname, `./inlined-scripts/${file}`),
606+
'utf-8'
607+
)
608+
]
609+
}
610+
604611
export default defineConfigWithTheme<ThemeConfig>({
605612
extends: baseConfig,
606613

@@ -639,25 +646,11 @@ export default defineConfigWithTheme<ThemeConfig>({
639646
'link',
640647
{
641648
rel: 'preconnect',
642-
href: 'https://sponsors.vuejs.org'
649+
href: 'https://automation.vuejs.org'
643650
}
644651
],
645-
[
646-
'script',
647-
{},
648-
fs.readFileSync(
649-
path.resolve(__dirname, './inlined-scripts/restorePreference.js'),
650-
'utf-8'
651-
)
652-
],
653-
[
654-
'script',
655-
{},
656-
fs.readFileSync(
657-
path.resolve(__dirname, './inlined-scripts/uwu.js'),
658-
'utf-8'
659-
)
660-
],
652+
inlineScript('restorePreference.js'),
653+
inlineScript('uwu.js'),
661654
[
662655
'script',
663656
{
@@ -673,7 +666,8 @@ export default defineConfigWithTheme<ThemeConfig>({
673666
src: 'https://vueschool.io/banner.js?affiliate=vuejs&type=top',
674667
async: 'true'
675668
}
676-
]
669+
],
670+
inlineScript('perfops.js')
677671
],
678672

679673
themeConfig: {
@@ -730,7 +724,7 @@ export default defineConfigWithTheme<ThemeConfig>({
730724
{
731725
link: 'https://ru.vuejs.org',
732726
text: 'Русский',
733-
repo: 'https://github.com/translation-gang/docs-ru'
727+
repo: 'https://github.com/vuejs-translations/docs-ru'
734728
},
735729
{
736730
link: 'https://cs.vuejs.org',
@@ -742,6 +736,11 @@ export default defineConfigWithTheme<ThemeConfig>({
742736
text: '繁體中文',
743737
repo: 'https://github.com/vuejs-translations/docs-zh-hk'
744738
},
739+
{
740+
link: 'https://pl.vuejs.org',
741+
text: 'Polski',
742+
repo: 'https://github.com/vuejs-translations/docs-pl',
743+
},
745744
{
746745
link: '/translations/',
747746
text: '帮助我们翻译!',

.vitepress/inlined-scripts/perfops.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
;((d) => {
2+
window.rum = { key: 'a9efvfeu' }
3+
var script = d.createElement('script')
4+
script.src = '/rom3.min.js'
5+
script.type = 'text/javascript'
6+
script.defer = true
7+
script.async = true
8+
d.getElementsByTagName('head')[0].appendChild(script)
9+
})(document)

.vitepress/inlined-scripts/restorePreference.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
restore('vue-docs-prefer-composition', 'prefer-composition', true)
99
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)
1010

11-
// window.__VUE_BANNER_ID__ = ''
12-
// restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
11+
window.__VUE_BANNER_ID__ = 'vueconf2025'
12+
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

.vitepress/theme/components/Banner.vue

Lines changed: 79 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,31 @@ function dismiss() {
2222

2323
<template>
2424
<div class="banner" v-if="open">
25-
<a target="_blank"></a>
25+
<p class="vt-banner-text">
26+
<span class="vt-text-primary">
27+
Vueconf.US
28+
</span>
29+
<span class="vt-tagline"> · The official Vue.js conf</span>
30+
<span class="vt-place"> · Tampa, USA</span>
31+
<span class="vt-date"> · 19-21 May 2025</span>
32+
<a target="_blank" class="vt-primary-action"
33+
href="https://vueconf.us/?utm_source=vuejs&utm_content=top_banner">
34+
Register
35+
</a>
36+
</p>
2637
<button @click="dismiss">
2738
<VTIconPlus class="close" />
2839
</button>
40+
<p class="vt-banner-text vt-coupon">
41+
<span class="vt-text-primary">Use</span> VUEJSDOCS
42+
<span class="vt-text-primary"> $200 off</span>
43+
</p>
2944
</div>
3045
</template>
3146

3247
<style>
3348
html:not(.banner-dismissed) {
34-
--vt-banner-height: 30px;
49+
--vt-banner-height: 60px;
3550
}
3651
</style>
3752

@@ -50,12 +65,12 @@ html:not(.banner-dismissed) {
5065
font-weight: 600;
5166
color: #fff;
5267
background-color: var(--vt-c-green);
53-
background: linear-gradient(
54-
90deg,
55-
rgba(66, 184, 131, 1) 0%,
56-
rgba(39, 179, 137, 1) 19%,
57-
rgba(100, 126, 255, 1) 100%
58-
);
68+
background: #0f172a;
69+
display: flex;
70+
justify-content: center;
71+
align-items: center;
72+
73+
5974
}
6075
6176
.banner-dismissed .banner {
@@ -70,7 +85,7 @@ button {
7085
position: absolute;
7186
right: 0;
7287
top: 0;
73-
padding: 5px;
88+
padding: 10px 10px;
7489
}
7590
7691
.close {
@@ -79,10 +94,61 @@ button {
7994
fill: #fff;
8095
transform: rotate(45deg);
8196
}
82-
/*
83-
@media (max-width: 720px) {
84-
a > span {
97+
98+
.vt-banner-text {
99+
color: #fff;
100+
font-size: 16px;
101+
}
102+
103+
.vt-text-primary {
104+
color: #75c05e;
105+
}
106+
107+
.vt-primary-action {
108+
background: #75c05e;
109+
color: #121c1a;
110+
padding: 8px 15px;
111+
border-radius: 5px;
112+
font-size: 14px;
113+
text-decoration: none;
114+
margin: 0 10px;
115+
font-weight: bold;
116+
}
117+
118+
.vt-primary-action:hover {
119+
text-decoration: none;
120+
background: #c4d141;
121+
}
122+
123+
@media (max-width: 1280px) {
124+
.banner .vt-banner-text {
125+
font-size: 14px;
126+
}
127+
128+
129+
}
130+
131+
@media (max-width: 780px) {
132+
.vt-tagline {
133+
display: none;
134+
}
135+
.vt-primary-action {
136+
margin: 0 10px;
137+
padding: 5px 5px;
138+
}
139+
140+
.vt-time-now {
141+
display: none;
142+
}
143+
}
144+
145+
@media (max-width: 560px) {
146+
147+
.vt-place {
85148
display: none;
86149
}
87-
} */
150+
.vt-date {
151+
display: none;
152+
}
153+
}
88154
</style>

.vitepress/theme/components/Home.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ onMounted(load)
7979
</template>
8080
</div>
8181
</section>
82-
<section v-else id="special-sponsor">
82+
<section v-else id="special-spsr">
8383
<span>
8484
<a href="/sponsor/#tier-benefits">
8585
中国区铂金赞助位现已空缺-立即咨询
@@ -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>
@@ -292,7 +292,7 @@ html:not(.dark) .accent,
292292
flex: 1;
293293
}
294294
295-
#special-sponsor span:first-child {
295+
#special-spsr span:first-child {
296296
text-align: right;
297297
}
298298
@@ -303,12 +303,12 @@ html:not(.dark) .accent,
303303
padding: 0 24px;
304304
}
305305
306-
#special-sponsor img {
306+
#special-spsr img {
307307
height: 42px;
308308
margin: -6px 0;
309309
}
310310
311-
.dark #special-sponsor img {
311+
.dark #special-spsr img {
312312
filter: grayscale(1) invert(1);
313313
}
314314
@@ -336,18 +336,18 @@ html:not(.dark) .accent,
336336
background-color: transparent;
337337
}
338338
339-
#sponsors {
339+
#spsrs {
340340
max-width: 900px;
341341
margin: 0px auto;
342342
}
343343
344-
#sponsors h2 {
344+
#spsrs h2 {
345345
font-size: 20px;
346346
font-weight: 600;
347347
margin-bottom: 1em;
348348
}
349349
350-
#sponsors .sponsor-container {
350+
#spsrs .spsr-container {
351351
margin-bottom: 3em;
352352
}
353353
@@ -380,15 +380,15 @@ html:not(.dark) .accent,
380380
font-size: 16px;
381381
margin: 18px 0 30px;
382382
}
383-
#special-sponsor {
383+
#special-spsr {
384384
flex-direction: column;
385385
height: auto;
386386
}
387-
#special-sponsor img {
387+
#special-spsr img {
388388
height: 36px;
389389
margin: 8px 0;
390390
}
391-
#special-sponsor span {
391+
#special-spsr span {
392392
text-align: center !important;
393393
}
394394
#highlights h3 {

0 commit comments

Comments
 (0)