diff --git a/.gitignore b/.gitignore index 7492b49ab..47e6fc431 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ dist/ # vitepress build output .vitepress/dist .vitepress/cache +.vitepress/.temp # Serverless directories .serverless/ diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 64f30b532..da98d3112 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { defineConfigWithTheme, type Plugin } from 'vitepress' +import { defineConfigWithTheme, type HeadConfig, type Plugin } from 'vitepress' import type { Config as ThemeConfig } from '@vue/theme' import llmstxt from 'vitepress-plugin-llms' import baseConfig from '@vue/theme/config' @@ -497,10 +497,6 @@ export const sidebar: ThemeConfig['sidebar'] = { text: '带过渡动效的列表', link: '/examples/#list-transition' }, - { - text: 'TodoMVC', - link: '/examples/#todomvc' - } ] }, { @@ -601,6 +597,17 @@ const i18n: ThemeConfig['i18n'] = { ariaSidebarNav: '侧边栏导航' } +function inlineScript(file: string): HeadConfig { + return [ + 'script', + {}, + fs.readFileSync( + path.resolve(__dirname, `./inlined-scripts/${file}`), + 'utf-8' + ) + ] +} + export default defineConfigWithTheme({ extends: baseConfig, @@ -639,25 +646,11 @@ export default defineConfigWithTheme({ 'link', { rel: 'preconnect', - href: 'https://sponsors.vuejs.org' + href: 'https://automation.vuejs.org' } ], - [ - 'script', - {}, - fs.readFileSync( - path.resolve(__dirname, './inlined-scripts/restorePreference.js'), - 'utf-8' - ) - ], - [ - 'script', - {}, - fs.readFileSync( - path.resolve(__dirname, './inlined-scripts/uwu.js'), - 'utf-8' - ) - ], + inlineScript('restorePreference.js'), + inlineScript('uwu.js'), [ 'script', { @@ -673,7 +666,8 @@ export default defineConfigWithTheme({ src: 'https://vueschool.io/banner.js?affiliate=vuejs&type=top', async: 'true' } - ] + ], + inlineScript('perfops.js') ], themeConfig: { @@ -730,7 +724,7 @@ export default defineConfigWithTheme({ { link: 'https://ru.vuejs.org', text: 'Русский', - repo: 'https://github.com/translation-gang/docs-ru' + repo: 'https://github.com/vuejs-translations/docs-ru' }, { link: 'https://cs.vuejs.org', @@ -742,6 +736,11 @@ export default defineConfigWithTheme({ text: '繁體中文', repo: 'https://github.com/vuejs-translations/docs-zh-hk' }, + { + link: 'https://pl.vuejs.org', + text: 'Polski', + repo: 'https://github.com/vuejs-translations/docs-pl', + }, { link: '/translations/', text: '帮助我们翻译!', diff --git a/.vitepress/inlined-scripts/perfops.js b/.vitepress/inlined-scripts/perfops.js new file mode 100644 index 000000000..381ff494a --- /dev/null +++ b/.vitepress/inlined-scripts/perfops.js @@ -0,0 +1,9 @@ +;((d) => { + window.rum = { key: 'a9efvfeu' } + var script = d.createElement('script') + script.src = '/rom3.min.js' + script.type = 'text/javascript' + script.defer = true + script.async = true + d.getElementsByTagName('head')[0].appendChild(script) +})(document) diff --git a/.vitepress/inlined-scripts/restorePreference.js b/.vitepress/inlined-scripts/restorePreference.js index 5e18b50ff..d4aab6093 100644 --- a/.vitepress/inlined-scripts/restorePreference.js +++ b/.vitepress/inlined-scripts/restorePreference.js @@ -8,6 +8,6 @@ restore('vue-docs-prefer-composition', 'prefer-composition', true) restore('vue-docs-prefer-sfc', 'prefer-sfc', true) - // window.__VUE_BANNER_ID__ = '' - // restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed') + window.__VUE_BANNER_ID__ = 'vueconf2025' + restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed') })() diff --git a/.vitepress/theme/components/Banner.vue b/.vitepress/theme/components/Banner.vue index 6730fcd48..a41d08221 100644 --- a/.vitepress/theme/components/Banner.vue +++ b/.vitepress/theme/components/Banner.vue @@ -22,16 +22,31 @@ function dismiss() { @@ -50,12 +65,12 @@ html:not(.banner-dismissed) { font-weight: 600; color: #fff; background-color: var(--vt-c-green); - background: linear-gradient( - 90deg, - rgba(66, 184, 131, 1) 0%, - rgba(39, 179, 137, 1) 19%, - rgba(100, 126, 255, 1) 100% - ); + background: #0f172a; + display: flex; + justify-content: center; + align-items: center; + + } .banner-dismissed .banner { @@ -70,7 +85,7 @@ button { position: absolute; right: 0; top: 0; - padding: 5px; + padding: 10px 10px; } .close { @@ -79,10 +94,61 @@ button { fill: #fff; transform: rotate(45deg); } -/* -@media (max-width: 720px) { - a > span { + +.vt-banner-text { + color: #fff; + font-size: 16px; +} + +.vt-text-primary { + color: #75c05e; +} + +.vt-primary-action { + background: #75c05e; + color: #121c1a; + padding: 8px 15px; + border-radius: 5px; + font-size: 14px; + text-decoration: none; + margin: 0 10px; + font-weight: bold; +} + +.vt-primary-action:hover { + text-decoration: none; + background: #c4d141; +} + +@media (max-width: 1280px) { + .banner .vt-banner-text { + font-size: 14px; + } + + +} + +@media (max-width: 780px) { + .vt-tagline { + display: none; + } + .vt-primary-action { + margin: 0 10px; + padding: 5px 5px; + } + + .vt-time-now { + display: none; + } +} + +@media (max-width: 560px) { + + .vt-place { display: none; } -} */ + .vt-date { + display: none; + } +} diff --git a/.vitepress/theme/components/Home.vue b/.vitepress/theme/components/Home.vue index f14894203..fe91a4c71 100644 --- a/.vitepress/theme/components/Home.vue +++ b/.vitepress/theme/components/Home.vue @@ -79,7 +79,7 @@ onMounted(load) -
+
中国区铂金赞助位现已空缺-立即咨询 @@ -107,7 +107,7 @@ onMounted(load)
-
+

Platinum Sponsors

Gold Sponsors

@@ -292,7 +292,7 @@ html:not(.dark) .accent, flex: 1; } -#special-sponsor span:first-child { +#special-spsr span:first-child { text-align: right; } @@ -303,12 +303,12 @@ html:not(.dark) .accent, padding: 0 24px; } -#special-sponsor img { +#special-spsr img { height: 42px; margin: -6px 0; } -.dark #special-sponsor img { +.dark #special-spsr img { filter: grayscale(1) invert(1); } @@ -336,18 +336,18 @@ html:not(.dark) .accent, background-color: transparent; } -#sponsors { +#spsrs { max-width: 900px; margin: 0px auto; } -#sponsors h2 { +#spsrs h2 { font-size: 20px; font-weight: 600; margin-bottom: 1em; } -#sponsors .sponsor-container { +#spsrs .spsr-container { margin-bottom: 3em; } @@ -380,15 +380,15 @@ html:not(.dark) .accent, font-size: 16px; margin: 18px 0 30px; } - #special-sponsor { + #special-spsr { flex-direction: column; height: auto; } - #special-sponsor img { + #special-spsr img { height: 36px; margin: 8px 0; } - #special-sponsor span { + #special-spsr span { text-align: center !important; } #highlights h3 { diff --git a/.vitepress/theme/components/SponsorsGroup.vue b/.vitepress/theme/components/SponsorsGroup.vue index c426d0878..f42254efa 100644 --- a/.vitepress/theme/components/SponsorsGroup.vue +++ b/.vitepress/theme/components/SponsorsGroup.vue @@ -47,7 +47,7 @@ function track(interest?: boolean) { } function resolveList(data: SponsorData) { - let currentTier = data[props.tier] + let currentTier = data[props.tier] || [] // in aside, treat platinum+priority as special if (props.placement === 'aside') { if (props.tier === 'platinum') { @@ -66,13 +66,13 @@ function resolveList(data: SponsorData) {