mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
docs: update VP theme configuration (#6051)
This commit is contained in:
parent
1b150a3891
commit
8c035988be
@ -37,8 +37,8 @@ export default ({ mode }: { mode: string }) => {
|
|||||||
},
|
},
|
||||||
head: [
|
head: [
|
||||||
['meta', { name: 'theme-color', content: '#729b1a' }],
|
['meta', { name: 'theme-color', content: '#729b1a' }],
|
||||||
['link', { rel: 'icon', href: '/favicon.ico', sizes: 'any' }],
|
['link', { rel: 'icon', href: '/favicon.ico', sizes: '48x48' }],
|
||||||
['link', { rel: 'icon', href: '/logo.svg', type: 'image/svg+xml' }],
|
['link', { rel: 'icon', href: '/logo.svg', sizes: 'any', type: 'image/svg+xml' }],
|
||||||
['meta', { name: 'author', content: `${teamMembers.map(c => c.name).join(', ')} and ${vitestName} contributors` }],
|
['meta', { name: 'author', content: `${teamMembers.map(c => c.name).join(', ')} and ${vitestName} contributors` }],
|
||||||
['meta', { name: 'keywords', content: 'vitest, vite, test, coverage, snapshot, react, vue, preact, svelte, solid, lit, marko, ruby, cypress, puppeteer, jsdom, happy-dom, test-runner, jest, typescript, esm, tinypool, tinyspy, node' }],
|
['meta', { name: 'keywords', content: 'vitest, vite, test, coverage, snapshot, react, vue, preact, svelte, solid, lit, marko, ruby, cypress, puppeteer, jsdom, happy-dom, test-runner, jest, typescript, esm, tinypool, tinyspy, node' }],
|
||||||
['meta', { property: 'og:title', content: vitestName }],
|
['meta', { property: 'og:title', content: vitestName }],
|
||||||
@ -139,7 +139,7 @@ export default ({ mode }: { mode: string }) => {
|
|||||||
link: releases,
|
link: releases,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Contributing ',
|
text: 'Contributing',
|
||||||
link: contributing,
|
link: contributing,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { h } from 'vue'
|
import { h } from 'vue'
|
||||||
import Theme, { VPBadge } from 'vitepress/theme'
|
import type { Theme } from 'vitepress'
|
||||||
import type { EnhanceAppContext } from 'vitepress'
|
import DefaultTheme from 'vitepress/theme'
|
||||||
import { inBrowser } from 'vitepress'
|
import { inBrowser } from 'vitepress'
|
||||||
import '../style/main.css'
|
import '../style/main.css'
|
||||||
import '../style/vars.css'
|
import '../style/vars.css'
|
||||||
@ -15,16 +15,14 @@ if (inBrowser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...Theme,
|
extends: DefaultTheme,
|
||||||
Layout() {
|
Layout() {
|
||||||
return h(Theme.Layout, null, {
|
return h(DefaultTheme.Layout, null, {
|
||||||
'home-features-after': () => h(HomePage),
|
'home-features-after': () => h(HomePage),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
enhanceApp({ app }: EnhanceAppContext) {
|
enhanceApp({ app }) {
|
||||||
// Vitepress v1+ doesn't seem to expose it as a global "Badge"
|
|
||||||
app.component('Badge', VPBadge)
|
|
||||||
app.component('Version', Version)
|
app.component('Version', Version)
|
||||||
app.use(TwoslashFloatingVue as any)
|
app.use(TwoslashFloatingVue)
|
||||||
},
|
},
|
||||||
}
|
} satisfies Theme
|
||||||
|
|||||||
@ -41,6 +41,7 @@ export const userEvent: {
|
|||||||
setup: () => UserEvent
|
setup: () => UserEvent
|
||||||
click: (element: Element, options?: UserEventClickOptions) => Promise<void>
|
click: (element: Element, options?: UserEventClickOptions) => Promise<void>
|
||||||
dblClick: (element: Element, options?: UserEventDoubleClickOptions) => Promise<void>
|
dblClick: (element: Element, options?: UserEventDoubleClickOptions) => Promise<void>
|
||||||
|
tripleClick: (element: Element, options?: UserEventTripleClickOptions) => Promise<void>
|
||||||
selectOptions: (
|
selectOptions: (
|
||||||
element: Element,
|
element: Element,
|
||||||
values: HTMLElement | HTMLElement[] | string | string[],
|
values: HTMLElement | HTMLElement[] | string | string[],
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"lib": ["DOM", "ESNext"],
|
"lib": ["DOM", "ESNext"],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "Bundler",
|
||||||
"paths": {
|
"paths": {
|
||||||
"~/*": ["src/*"]
|
"~/*": ["src/*"]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user