Skip to content

Commit 8f18fe7

Browse files
authored
docs: upgrade vitepress and add aside sponsors (#8363)
1 parent ea06d0c commit 8f18fe7

File tree

10 files changed

+72
-16
lines changed

10 files changed

+72
-16
lines changed

docs/.vitepress/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default defineConfig({
3535
},
3636

3737
carbonAds: {
38-
carbon: 'CEBIEK3N',
38+
code: 'CEBIEK3N',
3939
placement: 'vitejsdev'
4040
},
4141

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script setup lang="ts">
2+
import { computed } from 'vue'
3+
import { VPDocAsideSponsors } from 'vitepress/theme'
4+
import { useSponsor } from '../composables/sponsor'
5+
6+
const { data } = useSponsor()
7+
8+
const sponsors = computed(() => {
9+
return (
10+
data?.value.map((sponsor) => {
11+
return {
12+
size: sponsor.size === 'big' ? 'mini' : 'xmini',
13+
items: sponsor.items
14+
}
15+
}) ?? []
16+
)
17+
})
18+
</script>
19+
20+
<template>
21+
<VPDocAsideSponsors v-if="data" :data="sponsors" />
22+
</template>

docs/.vitepress/theme/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import Theme from 'vitepress/theme'
33
import './styles/vars.css'
44
import './styles/custom.css'
55
import HomeSponsors from './components/HomeSponsors.vue'
6+
import AsideSponsors from './components/AsideSponsors.vue'
67

78
export default {
89
...Theme,
910
Layout() {
1011
return h(Theme.Layout, null, {
11-
'home-features-after': () => h(HomeSponsors)
12+
'home-features-after': () => h(HomeSponsors),
13+
'aside-outline-after': () => h(AsideSponsors)
1214
})
1315
}
1416
}

docs/guide/env-and-mode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Vite exposes env variables on the special **`import.meta.env`** object. Some bui
1616

1717
During production, these env variables are **statically replaced**. It is therefore necessary to always reference them using the full static string. For example, dynamic key access like `import.meta.env[key]` will not work.
1818

19-
It will also replace these strings appearing in JavaScript strings and Vue templates. This should be a rare case, but it can be unintended. You may see errors like `Missing Semicolon` or `Unexpected token` in this case, for example when `"process.env.NODE_ENV: "` is transformed to `""development": "`. There are ways to work around this behavior:
19+
It will also replace these strings appearing in JavaScript strings and Vue templates. This should be a rare case, but it can be unintended. You may see errors like `Missing Semicolon` or `Unexpected token` in this case, for example when `"process.env.`<wbr>`NODE_ENV"` is transformed to `""development": "`. There are ways to work around this behavior:
2020

2121
- For JavaScript strings, you can break the string up with a Unicode zero-width space, e.g. `'import.meta\u200b.env.MODE'`.
2222

docs/guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Running `vite` starts the dev server using the current working directory as root
116116
In a project where Vite is installed, you can use the `vite` binary in your npm scripts, or run it directly with `npx vite`. Here are the default npm scripts in a scaffolded Vite project:
117117

118118
<!-- prettier-ignore -->
119-
```json5
119+
```json
120120
{
121121
"scripts": {
122122
"dev": "vite", // start dev server, aliases: `vite dev`, `vite serve`

docs/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
---
22
layout: home
33

4+
title: Vite
5+
titleTemplate: Next Generation Frontend Tooling
6+
47
hero:
58
name: Vite
69
text: Next Generation Frontend Tooling
710
tagline: Get ready for a development environment that can finally catch up with you.
11+
image:
12+
light: /vite-splash-light.jpg
13+
dark: /vite-splash-dark.jpg
814
actions:
915
- theme: brand
1016
text: Get Started

docs/public/vite-splash-dark.jpg

61.3 KB
Loading

docs/public/vite-splash-light.jpg

61.6 KB
Loading

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"typescript": "^4.6.4",
8989
"unbuild": "^0.7.4",
9090
"vite": "workspace:*",
91-
"vitepress": "1.0.0-draft.4",
91+
"vitepress": "1.0.0-draft.6",
9292
"vitest": "^0.12.9",
9393
"vue": "^3.2.35"
9494
},

pnpm-lock.yaml

+37-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)