Skip to content

Commit

Permalink
Merge pull request #665 from vitejs/dev
Browse files Browse the repository at this point in the history
Ready to release v4.0.0
  • Loading branch information
ShenQingchuan authored Dec 11, 2022
2 parents 8691491 + cf2ea53 commit 2c9f5fe
Show file tree
Hide file tree
Showing 30 changed files with 756 additions and 441 deletions.
36 changes: 22 additions & 14 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ export default defineConfig({
src: 'https://cdn.usefathom.com/script.js',
'data-site': 'CBDFBSLI',
'data-spa': 'auto',
defer: ''
}
]
defer: '',
},
],
],

vue: {
reactivityTransform: true
reactivityTransform: true,
},

themeConfig: {
logo: '/logo.svg',

editLink: {
pattern: 'https://github.com/vitejs/docs-cn/edit/main/docs/:path',
text: '为此页提供修改建议',
pattern: 'https://github.com/vitejs/docs-cn/edit/main/:path'
},

socialLinks: [
{ icon: 'twitter', link: 'https://twitter.com/vite_js' },
{ icon: 'discord', link: 'https://chat.vitejs.dev' },
{ icon: 'github', link: 'https://github.com/vitejs/vite' }
{ icon: 'github', link: 'https://github.com/vitejs/vite' },
],

algolia: {
Expand All @@ -62,16 +62,16 @@ export default defineConfig({

carbonAds: {
code: 'CEBIEK3N',
placement: 'vitejsdev'
placement: 'vitejsdev',
},

localeLinks: {
text: '简体中文',
items: [
{ text: 'English', link: 'https://vitejs.dev' },
{ text: '日本語', link: 'https://ja.vitejs.dev' },
{ text: 'Español', link: 'https://es.vitejs.dev' }
]
{ text: 'Español', link: 'https://es.vitejs.dev' },
],
},

footer: {
Expand Down Expand Up @@ -117,9 +117,13 @@ export default defineConfig({
text: 'Version',
items: [
{
text: 'Vite v2 文档',
text: 'Vite v3 文档(英文)',
link: 'https://v3.vitejs.dev'
},
{
text: 'Vite v2 文档(英文)',
link: 'https://v2.vitejs.dev'
}
},
]
}
],
Expand All @@ -141,6 +145,10 @@ export default defineConfig({
text: '功能',
link: '/guide/features'
},
{
text: '命令行界面',
link: '/guide/cli'
},
{
text: '使用插件',
link: '/guide/using-plugins'
Expand Down Expand Up @@ -182,7 +190,7 @@ export default defineConfig({
link: '/guide/troubleshooting'
},
{
text: '从 v2 迁移',
text: '从 v3 迁移',
link: '/guide/migration'
}
]
Expand All @@ -196,11 +204,11 @@ export default defineConfig({
},
{
text: 'HMR API',
link: '/guide/api-hmr'
link: '/guide/api-hmr',
},
{
text: 'JavaScript API',
link: '/guide/api-javascript'
link: '/guide/api-javascript',
},
{
text: '配置参考',
Expand Down
68 changes: 1 addition & 67 deletions .vitepress/theme/components/AsideSponsors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,79 +10,13 @@ const sponsors = computed(() => {
data?.value.map((sponsor) => {
return {
size: sponsor.size === 'big' ? 'mini' : 'xmini',
items: sponsor.items
items: sponsor.items,
}
}) ?? []
)
})
</script>

<template>
<a class="viteconf" href="https://viteconf.org" target="_blank">
<img width="22" height="22" src="/viteconf.svg" />
<span>
<p class="extra-info">Free Online Conference</p>
<p class="heading">ViteConf - Oct 11</p>
<p class="extra-info">Get your ticket now!</p>
</span>
</a>
<VPDocAsideSponsors v-if="data" :data="sponsors" />
</template>

<style>
.viteconf {
margin-top: 1rem;
margin-bottom: 1rem;
border-radius: 14px;
padding-left: 2.5rem;
padding-top: 0.4rem;
padding-bottom: 0.4rem;
position: relative;
font-size: 1rem;
font-weight: 700;
line-height: 1.1rem;
filter: grayscale(100%);
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
background-color: var(--vp-c-bg-alt);
border: 2px solid var(--vp-c-bg-alt);
transition: border-color 0.5s;
}
.viteconf:hover {
filter: grayscale(0%);
border: 2px solid var(--vp-c-brand-light);
}
.viteconf img {
position: absolute;
left: 1.5rem;
transition: transform 0.5s;
}
.viteconf:hover img {
transform: scale(1.75);
}
.viteconf:hover .heading {
background-image: linear-gradient(
120deg,
#bd34fe 16%,
var(--vp-c-brand-light),
var(--vp-c-brand-light)
);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.viteconf .extra-info {
color: var(--vp-c-text-1);
opacity: 0;
font-size: 0.7rem;
padding-left: 0.1rem;
transition: opacity 0.5s;
}
.viteconf:hover .extra-info {
opacity: 0.9;
}
</style>
10 changes: 5 additions & 5 deletions .vitepress/theme/composables/sponsor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function useSponsor() {
})

return {
data
data,
}
}

Expand All @@ -43,19 +43,19 @@ function mapSponsors(sponsors: Sponsors) {
{
tier: 'Platinum Sponsor',
size: 'big',
items: mapImgPath(sponsors['platinum'])
items: mapImgPath(sponsors['platinum']),
},
{
tier: 'Gold Sponsors',
size: 'medium',
items: mapImgPath(sponsors['gold'])
}
items: mapImgPath(sponsors['gold']),
},
]
}

function mapImgPath(sponsors: Sponsor[]) {
return sponsors.map((sponsor) => ({
...sponsor,
img: `${dataHost}/images/${sponsor.img}`
img: `${dataHost}/images/${sponsor.img}`,
}))
}
4 changes: 2 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export default {
Layout() {
return h(Theme.Layout, null, {
'home-features-after': () => h(HomeSponsors),
'aside-ads-before': () => h(AsideSponsors)
'aside-ads-before': () => h(AsideSponsors),
})
},
enhanceApp({ app }) {
app.component('SvgImage', SvgImage)
}
},
}
Loading

1 comment on commit 2c9f5fe

@vercel
Copy link

@vercel vercel bot commented on 2c9f5fe Dec 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cn-vitejs-dev – ./

cn-vitejs-dev-vuejs.vercel.app
cn.vitejs.dev
cn-vitejs-dev-git-main-vuejs.vercel.app
docs-cn.vercel.app

Please sign in to comment.