vitepress 2.0.0-alpha.2 → 2.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -2
- package/THIRD-PARTY-NOTICES.md +1736 -0
- package/bin/vitepress.js +14 -0
- package/client.d.ts +9 -0
- package/dist/client/app/components/ClientOnly.d.ts +5 -0
- package/dist/client/app/components/ClientOnly.js +11 -10
- package/dist/client/app/components/Content.d.ts +17 -0
- package/dist/client/app/components/Content.js +25 -22
- package/dist/client/app/composables/codeGroups.d.ts +3 -0
- package/dist/client/app/composables/codeGroups.js +36 -39
- package/dist/client/app/composables/copyCode.d.ts +3 -0
- package/dist/client/app/composables/copyCode.js +59 -70
- package/dist/client/app/composables/head.d.ts +5 -0
- package/dist/client/app/composables/head.js +56 -74
- package/dist/client/app/composables/icon.d.ts +12 -0
- package/dist/client/app/composables/icon.js +56 -0
- package/dist/client/app/composables/preFetch.d.ts +3 -0
- package/dist/client/app/composables/preFetch.js +64 -96
- package/dist/client/app/data.d.ts +9 -0
- package/dist/client/app/data.js +34 -59
- package/dist/client/app/devtools.d.ts +7 -0
- package/dist/client/app/devtools.js +29 -28
- package/dist/client/app/index.d.ts +11 -0
- package/dist/client/app/index.js +106 -131
- package/dist/client/app/router.d.ts +49 -0
- package/dist/client/app/router.js +198 -239
- package/dist/client/app/ssr.d.ts +4 -0
- package/dist/client/app/ssr.js +14 -9
- package/dist/client/app/theme.d.ts +24 -0
- package/dist/client/app/theme.js +0 -1
- package/dist/client/app/utils.d.ts +35 -0
- package/dist/client/app/utils.js +77 -110
- package/dist/client/index.d.ts +21 -137
- package/dist/client/index.js +8 -9
- package/dist/client/shared.d.ts +88 -0
- package/dist/client/shared.js +265 -141
- package/dist/client/theme-default/Layout.d.vue.ts +79 -0
- package/dist/client/theme-default/Layout.vue +33 -36
- package/dist/client/theme-default/NotFound.d.vue.ts +3 -0
- package/dist/client/theme-default/NotFound.vue +33 -35
- package/dist/client/theme-default/components/VPAlgoliaSearchBox.d.vue.ts +11 -0
- package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +202 -70
- package/dist/client/theme-default/components/VPBackdrop.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPBackdrop.vue +8 -12
- package/dist/client/theme-default/components/VPBadge.d.vue.ts +19 -0
- package/dist/client/theme-default/components/VPBadge.vue +49 -26
- package/dist/client/theme-default/components/VPButton.d.vue.ts +25 -0
- package/dist/client/theme-default/components/VPButton.vue +53 -36
- package/dist/client/theme-default/components/VPCarbonAds.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPCarbonAds.vue +51 -52
- package/dist/client/theme-default/components/VPContent.d.vue.ts +59 -0
- package/dist/client/theme-default/components/VPContent.vue +27 -26
- package/dist/client/theme-default/components/VPDoc.d.vue.ts +33 -0
- package/dist/client/theme-default/components/VPDoc.vue +52 -48
- package/dist/client/theme-default/components/VPDocAside.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPDocAside.vue +7 -8
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +7 -11
- package/dist/client/theme-default/components/VPDocAsideOutline.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPDocAsideOutline.vue +22 -38
- package/dist/client/theme-default/components/VPDocAsideSponsors.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPDocAsideSponsors.vue +17 -11
- package/dist/client/theme-default/components/VPDocFooter.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +38 -45
- package/dist/client/theme-default/components/VPDocFooterLastUpdated.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPDocFooterLastUpdated.vue +30 -29
- package/dist/client/theme-default/components/VPDocOutlineItem.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPDocOutlineItem.vue +20 -19
- package/dist/client/theme-default/components/VPFeature.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPFeature.vue +62 -36
- package/dist/client/theme-default/components/VPFeatures.d.vue.ts +16 -0
- package/dist/client/theme-default/components/VPFeatures.vue +35 -48
- package/dist/client/theme-default/components/VPFlyout.d.vue.ts +26 -0
- package/dist/client/theme-default/components/VPFlyout.vue +111 -47
- package/dist/client/theme-default/components/VPFooter.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPFooter.vue +22 -15
- package/dist/client/theme-default/components/VPHero.d.vue.ts +38 -0
- package/dist/client/theme-default/components/VPHero.vue +109 -99
- package/dist/client/theme-default/components/VPHome.d.vue.ts +31 -0
- package/dist/client/theme-default/components/VPHome.vue +15 -15
- package/dist/client/theme-default/components/VPHomeContent.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPHomeContent.vue +9 -27
- package/dist/client/theme-default/components/VPHomeFeatures.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPHomeFeatures.vue +4 -5
- package/dist/client/theme-default/components/VPHomeHero.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPHomeHero.vue +5 -5
- package/dist/client/theme-default/components/VPHomeSponsors.d.vue.ts +21 -0
- package/dist/client/theme-default/components/VPHomeSponsors.vue +42 -43
- package/dist/client/theme-default/components/VPIcon.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPIcon.vue +29 -0
- package/dist/client/theme-default/components/VPImage.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPImage.vue +20 -14
- package/dist/client/theme-default/components/VPLink.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPLink.vue +42 -23
- package/dist/client/theme-default/components/VPLocalNav.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPLocalNav.vue +69 -86
- package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue +98 -96
- package/dist/client/theme-default/components/VPLocalSearchBox.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPLocalSearchBox.vue +391 -454
- package/dist/client/theme-default/components/VPMenu.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPMenu.vue +19 -31
- package/dist/client/theme-default/components/VPMenuGroup.d.vue.ts +22 -0
- package/dist/client/theme-default/components/VPMenuGroup.vue +72 -18
- package/dist/client/theme-default/components/VPMenuLink.d.vue.ts +22 -0
- package/dist/client/theme-default/components/VPMenuLink.vue +65 -31
- package/dist/client/theme-default/components/VPNav.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPNav.vue +18 -24
- package/dist/client/theme-default/components/VPNavAppearance.d.vue.ts +9 -0
- package/dist/client/theme-default/components/VPNavAppearance.vue +88 -0
- package/dist/client/theme-default/components/VPNavBar.d.vue.ts +26 -0
- package/dist/client/theme-default/components/VPNavBar.vue +170 -142
- package/dist/client/theme-default/components/VPNavBarAskAiButton.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPNavBarAskAiButton.vue +31 -0
- package/dist/client/theme-default/components/VPNavBarExtra.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPNavBarExtra.vue +51 -73
- package/dist/client/theme-default/components/VPNavBarHamburger.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPNavBarHamburger.vue +38 -28
- package/dist/client/theme-default/components/VPNavBarSearch.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPNavBarSearch.vue +129 -160
- package/dist/client/theme-default/components/VPNavBarSearchButton.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPNavBarSearchButton.vue +48 -182
- package/dist/client/theme-default/components/VPNavBarTitle.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPNavBarTitle.vue +39 -38
- package/dist/client/theme-default/components/VPNavMenu.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPNavMenu.vue +76 -0
- package/dist/client/theme-default/components/VPNavMenuGroup.d.vue.ts +11 -0
- package/dist/client/theme-default/components/VPNavMenuGroup.vue +140 -0
- package/dist/client/theme-default/components/VPNavMenuLink.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPNavMenuLink.vue +69 -0
- package/dist/client/theme-default/components/VPNavScreen.d.vue.ts +18 -0
- package/dist/client/theme-default/components/VPNavScreen.vue +36 -34
- package/dist/client/theme-default/components/VPNavSocialLinks.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPNavSocialLinks.vue +36 -0
- package/dist/client/theme-default/components/VPNavTranslations.d.vue.ts +9 -0
- package/dist/client/theme-default/components/VPNavTranslations.vue +170 -0
- package/dist/client/theme-default/components/VPPage.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPSidebar.d.vue.ts +18 -0
- package/dist/client/theme-default/components/VPSidebar.vue +40 -53
- package/dist/client/theme-default/components/VPSidebarGroup.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPSidebarGroup.vue +24 -29
- package/dist/client/theme-default/components/VPSidebarItem.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPSidebarItem.vue +60 -93
- package/dist/client/theme-default/components/VPSkipLink.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPSkipLink.vue +23 -42
- package/dist/client/theme-default/components/VPSocialLink.d.vue.ts +11 -0
- package/dist/client/theme-default/components/VPSocialLink.vue +42 -49
- package/dist/client/theme-default/components/VPSocialLinks.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPSocialLinks.vue +26 -16
- package/dist/client/theme-default/components/VPSponsors.d.vue.ts +18 -0
- package/dist/client/theme-default/components/VPSponsors.vue +34 -33
- package/dist/client/theme-default/components/VPSponsorsGrid.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +23 -26
- package/dist/client/theme-default/components/VPSwitch.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPSwitch.vue +12 -13
- package/dist/client/theme-default/components/VPSwitchAppearance.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPSwitchAppearance.vue +16 -21
- package/dist/client/theme-default/components/VPTeamMembers.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPTeamMembers.vue +59 -32
- package/dist/client/theme-default/components/VPTeamMembersItem.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPTeamMembersItem.vue +62 -58
- package/dist/client/theme-default/components/VPTeamPage.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPTeamPage.vue +14 -14
- package/dist/client/theme-default/components/VPTeamPageSection.d.vue.ts +17 -0
- package/dist/client/theme-default/components/VPTeamPageSection.vue +20 -19
- package/dist/client/theme-default/components/VPTeamPageTitle.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPTeamPageTitle.vue +22 -22
- package/dist/client/theme-default/composables/data.d.ts +5 -0
- package/dist/client/theme-default/composables/data.js +5 -2
- package/dist/client/theme-default/composables/edit-link.d.ts +6 -0
- package/dist/client/theme-default/composables/edit-link.js +17 -15
- package/dist/client/theme-default/composables/flyout.d.ts +10 -0
- package/dist/client/theme-default/composables/flyout.js +33 -32
- package/dist/client/theme-default/composables/langs.d.ts +44 -0
- package/dist/client/theme-default/composables/langs.js +48 -24
- package/dist/client/theme-default/composables/layout.d.ts +13 -0
- package/dist/client/theme-default/composables/layout.js +68 -0
- package/dist/client/theme-default/composables/nav-overflow.d.ts +54 -0
- package/dist/client/theme-default/composables/nav-overflow.js +179 -0
- package/dist/client/theme-default/composables/nav.d.ts +25 -0
- package/dist/client/theme-default/composables/nav.js +58 -29
- package/dist/client/theme-default/composables/outline.d.ts +8 -0
- package/dist/client/theme-default/composables/outline.js +144 -166
- package/dist/client/theme-default/composables/prev-next.d.ts +16 -0
- package/dist/client/theme-default/composables/prev-next.js +34 -56
- package/dist/client/theme-default/composables/scroll-lock.d.ts +4 -0
- package/dist/client/theme-default/composables/scroll-lock.js +95 -0
- package/dist/client/theme-default/composables/sidebar.d.ts +25 -0
- package/dist/client/theme-default/composables/sidebar.js +96 -133
- package/dist/client/theme-default/composables/sponsor-grid.d.ts +10 -0
- package/dist/client/theme-default/composables/sponsor-grid.js +69 -76
- package/dist/client/theme-default/fonts/inter-italic-cyrillic-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-cyrillic.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-greek-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-greek.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-latin-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-latin.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-symbols.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-vietnamese.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-cyrillic-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-cyrillic.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-greek-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-greek.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-latin-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-latin.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-symbols.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-vietnamese.woff2 +0 -0
- package/dist/client/theme-default/index.d.ts +3 -0
- package/dist/client/theme-default/index.js +4 -3
- package/dist/client/theme-default/styles/base.css +279 -211
- package/dist/client/theme-default/styles/components/custom-block.css +12 -7
- package/dist/client/theme-default/styles/components/vp-code-group.css +13 -16
- package/dist/client/theme-default/styles/components/vp-code.css +10 -2
- package/dist/client/theme-default/styles/components/vp-doc.css +188 -142
- package/dist/client/theme-default/styles/components/vp-sponsor.css +48 -37
- package/dist/client/theme-default/styles/docsearch.css +138 -0
- package/dist/client/theme-default/styles/fonts.css +216 -55
- package/dist/client/theme-default/styles/icons.css +42 -22
- package/dist/client/theme-default/styles/vars.css +111 -46
- package/dist/client/theme-default/support/docsearch.d.ts +57 -0
- package/dist/client/theme-default/support/docsearch.js +145 -0
- package/dist/client/theme-default/support/local-search.d.ts +9 -0
- package/dist/client/theme-default/support/local-search.js +31 -0
- package/dist/client/theme-default/support/lru.d.ts +11 -0
- package/dist/client/theme-default/support/lru.js +30 -33
- package/dist/client/theme-default/support/reactivity.d.ts +4 -0
- package/dist/client/theme-default/support/reactivity.js +10 -0
- package/dist/client/theme-default/support/sidebar.d.ts +27 -0
- package/dist/client/theme-default/support/sidebar.js +69 -80
- package/dist/client/theme-default/support/translation.d.ts +6 -0
- package/dist/client/theme-default/support/translation.js +33 -47
- package/dist/client/theme-default/support/utils.d.ts +7 -0
- package/dist/client/theme-default/support/utils.js +39 -30
- package/dist/client/theme-default/without-fonts.d.ts +25 -0
- package/dist/client/theme-default/without-fonts.js +37 -36
- package/dist/node/chunk-BjrVv9r8.js +28627 -0
- package/dist/node/cli.d.ts +1 -0
- package/dist/node/cli.js +160 -423
- package/dist/node/index.d.ts +1761 -2476
- package/dist/node/index.js +1 -121
- package/dist/web-types.json +75 -0
- package/package.json +89 -98
- package/template/.vitepress/config.js +3 -1
- package/template/.vitepress/theme/style.css +3 -11
- package/theme.d.ts +30 -23
- package/types/default-theme.d.ts +109 -113
- package/types/docsearch.d.ts +61 -142
- package/types/shared.d.ts +469 -50
- package/dist/client/theme-default/components/VPNavBarAppearance.vue +0 -32
- package/dist/client/theme-default/components/VPNavBarMenu.vue +0 -40
- package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +0 -42
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +0 -53
- package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +0 -27
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +0 -47
- package/dist/client/theme-default/components/VPNavScreenAppearance.vue +0 -40
- package/dist/client/theme-default/components/VPNavScreenMenu.vue +0 -26
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +0 -112
- package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +0 -40
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +0 -34
- package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +0 -43
- package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +0 -14
- package/dist/client/theme-default/components/VPNavScreenTranslations.vue +0 -73
- package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +0 -8
- package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +0 -8
- package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +0 -8
- package/dist/client/theme-default/components/icons/VPIconArrowLeft.vue +0 -7
- package/dist/client/theme-default/components/icons/VPIconArrowRight.vue +0 -7
- package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconEdit.vue +0 -6
- package/dist/client/theme-default/components/icons/VPIconHeart.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconLanguages.vue +0 -9
- package/dist/client/theme-default/components/icons/VPIconMinus.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +0 -6
- package/dist/client/theme-default/components/icons/VPIconMoon.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +0 -7
- package/dist/client/theme-default/components/icons/VPIconPlus.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +0 -6
- package/dist/client/theme-default/components/icons/VPIconSun.vue +0 -13
- package/dist/client/theme-default/composables/aside.js +0 -17
- package/dist/client/theme-default/composables/local-nav.js +0 -18
- package/dist/node/chunk-C-d2RJOW.js +0 -470
- package/dist/node/chunk-CxQfvv8o.js +0 -49065
- package/dist/node/worker_shikiResolveLang.js +0 -13
package/types/shared.d.ts
CHANGED
|
@@ -1,71 +1,130 @@
|
|
|
1
1
|
// types shared between server and client
|
|
2
2
|
import type { UseDarkOptions } from '@vueuse/core'
|
|
3
|
+
import type { Component, Ref } from 'vue'
|
|
3
4
|
import type { SSRContext } from 'vue/server-renderer'
|
|
4
5
|
export type { DefaultTheme } from './default-theme.js'
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* A value of type `T`, or a promise resolving to it.
|
|
9
|
+
*/
|
|
6
10
|
export type Awaitable<T> = T | PromiseLike<T>
|
|
7
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Recursively makes all properties of `T` optional, leaving non-plain
|
|
14
|
+
* objects (dates, regexps, functions, collections) as-is.
|
|
15
|
+
*/
|
|
16
|
+
export type DeepPartial<T> =
|
|
17
|
+
T extends Record<string, any>
|
|
18
|
+
? T extends
|
|
19
|
+
| Date
|
|
20
|
+
| RegExp
|
|
21
|
+
| Function
|
|
22
|
+
| ReadonlyMap<any, any>
|
|
23
|
+
| ReadonlySet<any>
|
|
24
|
+
| ReadonlyArray<any>
|
|
25
|
+
? T
|
|
26
|
+
: { [P in keyof T]?: DeepPartial<T[P]> }
|
|
27
|
+
: T
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The data of a page, available on both server and client.
|
|
31
|
+
*/
|
|
8
32
|
export interface PageData {
|
|
33
|
+
/**
|
|
34
|
+
* The path of the page relative to the source directory, with rewrites
|
|
35
|
+
* applied. Determines the URL of the page.
|
|
36
|
+
*/
|
|
9
37
|
relativePath: string
|
|
10
38
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
39
|
+
* The path of the actual source file relative to the source directory:
|
|
40
|
+
* differs from `relativePath` when rewrites are in use, points to the
|
|
41
|
+
* route template for dynamic routes, and is empty for virtual pages
|
|
42
|
+
* (e.g. the 404 page).
|
|
13
43
|
*/
|
|
14
44
|
filePath: string
|
|
45
|
+
/**
|
|
46
|
+
* The title of the page, from its frontmatter or its first level-1
|
|
47
|
+
* heading.
|
|
48
|
+
*/
|
|
15
49
|
title: string
|
|
50
|
+
/**
|
|
51
|
+
* The suffix appended to the title (`title | suffix`), or a template
|
|
52
|
+
* containing the `:title` token. Set to `false` to use the title as-is.
|
|
53
|
+
*/
|
|
16
54
|
titleTemplate?: string | boolean
|
|
55
|
+
/**
|
|
56
|
+
* The description of the page, from its frontmatter.
|
|
57
|
+
*/
|
|
17
58
|
description: string
|
|
59
|
+
/**
|
|
60
|
+
* The section headers extracted from the page.
|
|
61
|
+
*/
|
|
18
62
|
headers: Header[]
|
|
63
|
+
/**
|
|
64
|
+
* The frontmatter of the page.
|
|
65
|
+
*/
|
|
19
66
|
frontmatter: Record<string, any>
|
|
67
|
+
/**
|
|
68
|
+
* The route params of the page, if it belongs to a dynamic route.
|
|
69
|
+
*/
|
|
20
70
|
params?: Record<string, any>
|
|
71
|
+
/**
|
|
72
|
+
* Whether the page is the not-found (404) page.
|
|
73
|
+
*/
|
|
21
74
|
isNotFound?: boolean
|
|
75
|
+
/**
|
|
76
|
+
* The timestamp (in milliseconds) of the last update, from the page's
|
|
77
|
+
* frontmatter or its last git commit.
|
|
78
|
+
*/
|
|
22
79
|
lastUpdated?: number
|
|
23
80
|
}
|
|
24
81
|
|
|
25
82
|
/**
|
|
26
|
-
*
|
|
83
|
+
* A block of the Vue SFC generated from a markdown source file.
|
|
27
84
|
*/
|
|
28
85
|
export interface SfcBlock {
|
|
29
86
|
/**
|
|
30
|
-
* The type of the block
|
|
87
|
+
* The type of the block.
|
|
31
88
|
*/
|
|
32
89
|
type: string
|
|
33
90
|
/**
|
|
34
|
-
* The content, including open
|
|
91
|
+
* The content of the block, including its open and close tags.
|
|
35
92
|
*/
|
|
36
93
|
content: string
|
|
37
94
|
/**
|
|
38
|
-
* The content
|
|
95
|
+
* The content of the block, with its open and close tags stripped.
|
|
39
96
|
*/
|
|
40
97
|
contentStripped: string
|
|
41
98
|
/**
|
|
42
|
-
* The open
|
|
99
|
+
* The open tag of the block.
|
|
43
100
|
*/
|
|
44
101
|
tagOpen: string
|
|
45
102
|
/**
|
|
46
|
-
* The close
|
|
103
|
+
* The close tag of the block.
|
|
47
104
|
*/
|
|
48
105
|
tagClose: string
|
|
49
106
|
}
|
|
50
107
|
|
|
108
|
+
/**
|
|
109
|
+
* The SFC blocks extracted from a markdown source file.
|
|
110
|
+
*/
|
|
51
111
|
export interface MarkdownSfcBlocks {
|
|
52
112
|
/**
|
|
53
|
-
* The `<template>` block
|
|
113
|
+
* The `<template>` block.
|
|
54
114
|
*/
|
|
55
115
|
template: SfcBlock | null
|
|
56
116
|
/**
|
|
57
|
-
* The common `<script>` block
|
|
117
|
+
* The common `<script>` block.
|
|
58
118
|
*/
|
|
59
119
|
script: SfcBlock | null
|
|
60
120
|
/**
|
|
61
|
-
* The `<script setup>` block
|
|
121
|
+
* The `<script setup>` block.
|
|
62
122
|
*/
|
|
63
123
|
scriptSetup: SfcBlock | null
|
|
64
124
|
/**
|
|
65
|
-
* All `<script>` blocks.
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* However, some tools may support different types of `<script>`s, so we keep all of them here.
|
|
125
|
+
* All `<script>` blocks. An SFC normally allows a single `<script>` block
|
|
126
|
+
* and a single `<script setup>` block, but some tools may support more,
|
|
127
|
+
* so all of them are kept here.
|
|
69
128
|
*/
|
|
70
129
|
scripts: SfcBlock[]
|
|
71
130
|
/**
|
|
@@ -78,130 +137,490 @@ export interface MarkdownSfcBlocks {
|
|
|
78
137
|
customBlocks: SfcBlock[]
|
|
79
138
|
}
|
|
80
139
|
|
|
140
|
+
/**
|
|
141
|
+
* A section header extracted from a page.
|
|
142
|
+
*/
|
|
81
143
|
export interface Header {
|
|
82
144
|
/**
|
|
83
|
-
* The level of the header
|
|
84
|
-
*
|
|
85
|
-
* `1` to `6` for `<h1>` to `<h6>`
|
|
145
|
+
* The level of the header, `1` to `6` for `<h1>` to `<h6>`.
|
|
86
146
|
*/
|
|
87
147
|
level: number
|
|
88
148
|
/**
|
|
89
|
-
* The title of the header
|
|
149
|
+
* The title of the header.
|
|
90
150
|
*/
|
|
91
151
|
title: string
|
|
92
152
|
/**
|
|
93
|
-
* The slug of the header
|
|
94
|
-
*
|
|
95
|
-
* Typically the `id` attr of the header anchor
|
|
153
|
+
* The slug of the header, typically the `id` attribute of its anchor.
|
|
96
154
|
*/
|
|
97
155
|
slug: string
|
|
98
156
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* Typically using `#${slug}` as the anchor hash
|
|
157
|
+
* The link of the header, typically `#${slug}`.
|
|
102
158
|
*/
|
|
103
159
|
link: string
|
|
104
160
|
/**
|
|
105
|
-
* The
|
|
161
|
+
* The nested child headers.
|
|
106
162
|
*/
|
|
107
163
|
children: Header[]
|
|
108
164
|
}
|
|
109
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Site-level data, resolved from the user config for the active locale.
|
|
168
|
+
*/
|
|
110
169
|
export interface SiteData<ThemeConfig = any> {
|
|
170
|
+
/**
|
|
171
|
+
* The base URL the site is deployed at, or `'./'` when each page
|
|
172
|
+
* references the site relative to its own depth.
|
|
173
|
+
* @default '/'
|
|
174
|
+
*/
|
|
111
175
|
base: string
|
|
176
|
+
/**
|
|
177
|
+
* Whether VitePress generates URLs without a trailing `.html`.
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
112
180
|
cleanUrls?: boolean
|
|
181
|
+
/**
|
|
182
|
+
* The `lang` attribute of the site.
|
|
183
|
+
* @default 'en-US'
|
|
184
|
+
*/
|
|
113
185
|
lang: string
|
|
114
|
-
|
|
186
|
+
/**
|
|
187
|
+
* The text direction (`dir` attribute) of the site.
|
|
188
|
+
* @default 'ltr'
|
|
189
|
+
*/
|
|
190
|
+
dir: 'ltr' | 'rtl' | 'auto'
|
|
191
|
+
/**
|
|
192
|
+
* The title of the site.
|
|
193
|
+
* @default 'VitePress'
|
|
194
|
+
*/
|
|
115
195
|
title: string
|
|
196
|
+
/**
|
|
197
|
+
* The suffix appended to page titles (`title | suffix`), or a template
|
|
198
|
+
* containing the `:title` token. Set to `false` to use page titles as-is.
|
|
199
|
+
*/
|
|
116
200
|
titleTemplate?: string | boolean
|
|
201
|
+
/**
|
|
202
|
+
* The description of the site.
|
|
203
|
+
* @default 'A VitePress site'
|
|
204
|
+
*/
|
|
117
205
|
description: string
|
|
206
|
+
/**
|
|
207
|
+
* Additional elements to render in the `<head>` tag of every page.
|
|
208
|
+
*/
|
|
118
209
|
head: HeadConfig[]
|
|
210
|
+
/**
|
|
211
|
+
* The dark mode behavior: `true` for a toggleable dark mode, `'dark'` to
|
|
212
|
+
* default to it, `'force-dark'`/`'force-auto'` to force the mode, or
|
|
213
|
+
* options for `useDark` from `@vueuse/core`. `false` disables it.
|
|
214
|
+
* @default true
|
|
215
|
+
*/
|
|
119
216
|
appearance:
|
|
120
217
|
| boolean
|
|
121
218
|
| 'dark'
|
|
122
219
|
| 'force-dark'
|
|
123
220
|
| 'force-auto'
|
|
124
221
|
| (Omit<UseDarkOptions, 'initialValue'> & { initialValue?: 'dark' })
|
|
222
|
+
/**
|
|
223
|
+
* The config of the active theme.
|
|
224
|
+
*/
|
|
125
225
|
themeConfig: ThemeConfig
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
| { selector: string | string[]; padding: number }
|
|
226
|
+
/**
|
|
227
|
+
* The config overrides of each locale, keyed by its directory
|
|
228
|
+
* (`'root'` for the default locale).
|
|
229
|
+
*/
|
|
131
230
|
locales: LocaleConfig<ThemeConfig>
|
|
231
|
+
/**
|
|
232
|
+
* The key of the active locale in `locales`.
|
|
233
|
+
*/
|
|
132
234
|
localeIndex?: string
|
|
235
|
+
/**
|
|
236
|
+
* Props passed to the wrapper element rendered by the `Content` component.
|
|
237
|
+
*/
|
|
133
238
|
contentProps?: Record<string, any>
|
|
239
|
+
/**
|
|
240
|
+
* Client router options.
|
|
241
|
+
*/
|
|
134
242
|
router: {
|
|
243
|
+
/**
|
|
244
|
+
* Whether links are prefetched when they enter the viewport.
|
|
245
|
+
* @default true
|
|
246
|
+
*/
|
|
135
247
|
prefetchLinks: boolean
|
|
136
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Config overrides applied to pages by source directory (before
|
|
251
|
+
* rewrites): a dict mapping a directory (e.g. `/guide/`) to overrides,
|
|
252
|
+
* deeper directories taking precedence, or a function returning the
|
|
253
|
+
* overrides for a page.
|
|
254
|
+
*/
|
|
255
|
+
additionalConfig?:
|
|
256
|
+
AdditionalConfigDict<ThemeConfig> | AdditionalConfigLoader<ThemeConfig>
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Reactive data exposed by the `useData` composable.
|
|
261
|
+
*/
|
|
262
|
+
export interface VitePressData<T = any> {
|
|
263
|
+
/**
|
|
264
|
+
* The site-level data for the active locale.
|
|
265
|
+
*/
|
|
266
|
+
site: Ref<SiteData<T>>
|
|
267
|
+
/**
|
|
268
|
+
* The config of the active theme.
|
|
269
|
+
*/
|
|
270
|
+
theme: Ref<T>
|
|
271
|
+
/**
|
|
272
|
+
* The data of the current page.
|
|
273
|
+
*/
|
|
274
|
+
page: Ref<PageData>
|
|
275
|
+
/**
|
|
276
|
+
* The frontmatter of the current page.
|
|
277
|
+
*/
|
|
278
|
+
frontmatter: Ref<PageData['frontmatter']>
|
|
279
|
+
/**
|
|
280
|
+
* The route params of the current page.
|
|
281
|
+
*/
|
|
282
|
+
params: Ref<PageData['params']>
|
|
283
|
+
/**
|
|
284
|
+
* The resolved title of the current page.
|
|
285
|
+
*/
|
|
286
|
+
title: Ref<string>
|
|
287
|
+
/**
|
|
288
|
+
* The resolved description of the current page.
|
|
289
|
+
*/
|
|
290
|
+
description: Ref<string>
|
|
291
|
+
/**
|
|
292
|
+
* The `lang` attribute of the active locale.
|
|
293
|
+
*/
|
|
294
|
+
lang: Ref<string>
|
|
295
|
+
/**
|
|
296
|
+
* The text direction of the active locale.
|
|
297
|
+
*/
|
|
298
|
+
dir: Ref<'ltr' | 'rtl' | 'auto'>
|
|
299
|
+
/**
|
|
300
|
+
* The key of the active locale.
|
|
301
|
+
*/
|
|
302
|
+
localeIndex: Ref<string>
|
|
303
|
+
/**
|
|
304
|
+
* Whether dark mode is currently active.
|
|
305
|
+
*/
|
|
306
|
+
isDark: Ref<boolean>
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* The currently matched route.
|
|
311
|
+
*/
|
|
312
|
+
export interface Route {
|
|
313
|
+
/**
|
|
314
|
+
* The pathname of the current URL.
|
|
315
|
+
*/
|
|
316
|
+
path: string
|
|
317
|
+
/**
|
|
318
|
+
* The hash of the current URL, including the leading `#`.
|
|
319
|
+
*/
|
|
320
|
+
hash: string
|
|
321
|
+
/**
|
|
322
|
+
* The query string of the current URL, including the leading `?`.
|
|
323
|
+
*/
|
|
324
|
+
query: string
|
|
325
|
+
/**
|
|
326
|
+
* The data of the matched page.
|
|
327
|
+
*/
|
|
328
|
+
data: PageData
|
|
329
|
+
/**
|
|
330
|
+
* The component of the matched page, once resolved.
|
|
331
|
+
*/
|
|
332
|
+
component: Component | null
|
|
137
333
|
}
|
|
138
334
|
|
|
335
|
+
/**
|
|
336
|
+
* A head entry as `[tag, attrs]` or `[tag, attrs, innerHTML]`, e.g.
|
|
337
|
+
* `['link', { rel: 'icon', href: '/favicon.ico' }]`.
|
|
338
|
+
*/
|
|
139
339
|
export type HeadConfig =
|
|
140
|
-
| [string, Record<string, string
|
|
141
|
-
| [string, Record<string, string>, string]
|
|
340
|
+
[string, Record<string, string>] | [string, Record<string, string>, string]
|
|
142
341
|
|
|
342
|
+
/**
|
|
343
|
+
* The payload sent to the client when page data is hot-updated.
|
|
344
|
+
*/
|
|
143
345
|
export interface PageDataPayload {
|
|
346
|
+
/**
|
|
347
|
+
* The path of the updated page relative to the source directory, with
|
|
348
|
+
* rewrites applied and a leading slash.
|
|
349
|
+
*/
|
|
144
350
|
path: string
|
|
351
|
+
/**
|
|
352
|
+
* The new data of the updated page.
|
|
353
|
+
*/
|
|
145
354
|
pageData: PageData
|
|
146
355
|
}
|
|
147
356
|
|
|
357
|
+
/**
|
|
358
|
+
* The SSR context used when rendering a page to static HTML.
|
|
359
|
+
*/
|
|
148
360
|
export interface SSGContext extends SSRContext {
|
|
361
|
+
/**
|
|
362
|
+
* The rendered HTML content of the page.
|
|
363
|
+
*/
|
|
149
364
|
content: string
|
|
150
|
-
/**
|
|
151
|
-
|
|
365
|
+
/**
|
|
366
|
+
* The icons used on the page, registered during SSR (via `useIcon`) so
|
|
367
|
+
* that only their styles are emitted. Names are fully qualified as
|
|
368
|
+
* `collection:name`.
|
|
369
|
+
*/
|
|
370
|
+
vpIcons: Set<string>
|
|
152
371
|
}
|
|
153
372
|
|
|
373
|
+
/**
|
|
374
|
+
* The site config options that can be overridden per locale.
|
|
375
|
+
*/
|
|
154
376
|
export interface LocaleSpecificConfig<ThemeConfig = any> {
|
|
377
|
+
/**
|
|
378
|
+
* The `lang` attribute of the locale.
|
|
379
|
+
*/
|
|
155
380
|
lang?: string
|
|
156
|
-
|
|
381
|
+
/**
|
|
382
|
+
* The text direction of the locale.
|
|
383
|
+
*/
|
|
384
|
+
dir?: 'ltr' | 'rtl' | 'auto'
|
|
385
|
+
/**
|
|
386
|
+
* The title of the site in the locale.
|
|
387
|
+
*/
|
|
157
388
|
title?: string
|
|
389
|
+
/**
|
|
390
|
+
* The suffix appended to page titles (`title | suffix`), or a template
|
|
391
|
+
* containing the `:title` token. Set to `false` to use page titles as-is.
|
|
392
|
+
*/
|
|
158
393
|
titleTemplate?: string | boolean
|
|
394
|
+
/**
|
|
395
|
+
* The description of the site in the locale.
|
|
396
|
+
*/
|
|
159
397
|
description?: string
|
|
398
|
+
/**
|
|
399
|
+
* Additional head entries for the locale, merged with the root ones.
|
|
400
|
+
*/
|
|
160
401
|
head?: HeadConfig[]
|
|
161
|
-
|
|
402
|
+
/**
|
|
403
|
+
* Theme config overrides for the locale, merged with the root theme
|
|
404
|
+
* config.
|
|
405
|
+
*/
|
|
406
|
+
themeConfig?: DeepPartial<ThemeConfig>
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* The labels of custom containers and GitHub-style alerts.
|
|
411
|
+
*/
|
|
412
|
+
export interface ContainerOptions {
|
|
413
|
+
/**
|
|
414
|
+
* The label of `::: info` containers.
|
|
415
|
+
* @default 'INFO'
|
|
416
|
+
*/
|
|
417
|
+
infoLabel?: string
|
|
418
|
+
/**
|
|
419
|
+
* The label of `> [!NOTE]` alerts.
|
|
420
|
+
* @default 'NOTE'
|
|
421
|
+
*/
|
|
422
|
+
noteLabel?: string
|
|
423
|
+
/**
|
|
424
|
+
* The label of `::: tip` containers.
|
|
425
|
+
* @default 'TIP'
|
|
426
|
+
*/
|
|
427
|
+
tipLabel?: string
|
|
428
|
+
/**
|
|
429
|
+
* The label of `::: warning` containers.
|
|
430
|
+
* @default 'WARNING'
|
|
431
|
+
*/
|
|
432
|
+
warningLabel?: string
|
|
433
|
+
/**
|
|
434
|
+
* The label of `::: danger` containers.
|
|
435
|
+
* @default 'DANGER'
|
|
436
|
+
*/
|
|
437
|
+
dangerLabel?: string
|
|
438
|
+
/**
|
|
439
|
+
* The label of `::: details` containers.
|
|
440
|
+
* @default 'Details'
|
|
441
|
+
*/
|
|
442
|
+
detailsLabel?: string
|
|
443
|
+
/**
|
|
444
|
+
* The label of `> [!IMPORTANT]` alerts.
|
|
445
|
+
* @default 'IMPORTANT'
|
|
446
|
+
*/
|
|
447
|
+
importantLabel?: string
|
|
448
|
+
/**
|
|
449
|
+
* The label of `> [!CAUTION]` alerts.
|
|
450
|
+
* @default 'CAUTION'
|
|
451
|
+
*/
|
|
452
|
+
cautionLabel?: string
|
|
453
|
+
/**
|
|
454
|
+
* Additional containers to register, mapping the container name to its
|
|
455
|
+
* default title. Names must be lowercase (letters, numbers, hyphens,
|
|
456
|
+
* underscores), work as both `::: name` blocks and `> [!NAME]` alerts,
|
|
457
|
+
* and are styleable via `.custom-block.name`. Locale overrides may only
|
|
458
|
+
* change the titles of root-registered names.
|
|
459
|
+
*/
|
|
460
|
+
customContainers?: Record<string, string>
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* The strings used by the copy button in code blocks.
|
|
465
|
+
*/
|
|
466
|
+
export interface CodeCopyButtonOptions {
|
|
467
|
+
/**
|
|
468
|
+
* The tooltip (`title` attribute) of the copy button in code blocks.
|
|
469
|
+
* @default 'Copy code'
|
|
470
|
+
*/
|
|
471
|
+
tooltipText?: string
|
|
472
|
+
/**
|
|
473
|
+
* The text shown next to the copy button after copying.
|
|
474
|
+
* @default 'Copied'
|
|
475
|
+
*/
|
|
476
|
+
copiedText?: string
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Markdown strings overridable per locale via `locales.<index>.markdown`,
|
|
481
|
+
* falling back to the root `markdown` options when unset.
|
|
482
|
+
*/
|
|
483
|
+
export interface MarkdownLocaleOptions {
|
|
484
|
+
/**
|
|
485
|
+
* Locale-specific labels for containers (`::: tip` etc.) and
|
|
486
|
+
* GitHub-flavored alerts.
|
|
487
|
+
*/
|
|
488
|
+
container?: ContainerOptions
|
|
489
|
+
/**
|
|
490
|
+
* Locale-specific strings for the copy button in code blocks.
|
|
491
|
+
*/
|
|
492
|
+
codeCopyButton?: CodeCopyButtonOptions
|
|
162
493
|
}
|
|
163
494
|
|
|
495
|
+
/**
|
|
496
|
+
* The locale configs of the site, keyed by locale directory
|
|
497
|
+
* (`'root'` for the default locale).
|
|
498
|
+
*/
|
|
164
499
|
export type LocaleConfig<ThemeConfig = any> = Record<
|
|
165
500
|
string,
|
|
166
|
-
LocaleSpecificConfig<ThemeConfig> & {
|
|
501
|
+
LocaleSpecificConfig<ThemeConfig> & {
|
|
502
|
+
/**
|
|
503
|
+
* The label of the locale in the locale menu.
|
|
504
|
+
*/
|
|
505
|
+
label: string
|
|
506
|
+
/**
|
|
507
|
+
* The link of the locale menu item. Defaults to the locale directory.
|
|
508
|
+
*/
|
|
509
|
+
link?: string
|
|
510
|
+
/**
|
|
511
|
+
* The markdown strings of the locale.
|
|
512
|
+
*/
|
|
513
|
+
markdown?: MarkdownLocaleOptions
|
|
514
|
+
}
|
|
167
515
|
>
|
|
168
516
|
|
|
169
|
-
|
|
170
|
-
|
|
517
|
+
/**
|
|
518
|
+
* Config overrides applied to a page on top of its locale config.
|
|
519
|
+
*/
|
|
520
|
+
export type AdditionalConfig<ThemeConfig = any> =
|
|
521
|
+
LocaleSpecificConfig<ThemeConfig>
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Additional configs keyed by the source directory they apply to
|
|
525
|
+
* (e.g. `/guide/`).
|
|
526
|
+
*/
|
|
527
|
+
export type AdditionalConfigDict<ThemeConfig = any> = Record<
|
|
528
|
+
string,
|
|
529
|
+
AdditionalConfig<ThemeConfig>
|
|
530
|
+
>
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Resolves the additional configs of a page from its source path, ordered
|
|
534
|
+
* from highest to lowest priority.
|
|
535
|
+
*/
|
|
536
|
+
export type AdditionalConfigLoader<ThemeConfig = any> = (
|
|
537
|
+
filePath: string
|
|
538
|
+
) => AdditionalConfig<ThemeConfig>[] | void
|
|
171
539
|
|
|
540
|
+
// all properties are declared manually as rollup-plugin-dts cannot merge
|
|
541
|
+
// augmented module declarations
|
|
542
|
+
/**
|
|
543
|
+
* The environment object passed to `markdown-it` when rendering a page.
|
|
544
|
+
*/
|
|
172
545
|
export interface MarkdownEnv {
|
|
173
546
|
/**
|
|
174
|
-
* The raw
|
|
547
|
+
* The raw markdown content, with the frontmatter stripped.
|
|
175
548
|
*/
|
|
176
549
|
content?: string
|
|
177
550
|
/**
|
|
178
|
-
* The excerpt
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* - Would be the raw Markdown when `renderExcerpt` is disabled
|
|
551
|
+
* The excerpt extracted by `@mdit-vue/plugin-frontmatter`, rendered as
|
|
552
|
+
* HTML when excerpt rendering is enabled and kept as raw markdown
|
|
553
|
+
* otherwise.
|
|
182
554
|
*/
|
|
183
555
|
excerpt?: string
|
|
184
556
|
/**
|
|
185
|
-
* The frontmatter
|
|
557
|
+
* The frontmatter extracted by `@mdit-vue/plugin-frontmatter`.
|
|
186
558
|
*/
|
|
187
559
|
frontmatter?: Record<string, unknown>
|
|
188
560
|
/**
|
|
189
|
-
* The headers
|
|
561
|
+
* The headers extracted by `@mdit-vue/plugin-headers`.
|
|
190
562
|
*/
|
|
191
563
|
headers?: Header[]
|
|
192
564
|
/**
|
|
193
|
-
* SFC blocks
|
|
565
|
+
* The SFC blocks extracted by `@mdit-vue/plugin-sfc`.
|
|
194
566
|
*/
|
|
195
567
|
sfcBlocks?: MarkdownSfcBlocks
|
|
196
568
|
/**
|
|
197
|
-
* The title
|
|
569
|
+
* The title extracted by `@mdit-vue/plugin-title`.
|
|
198
570
|
*/
|
|
199
571
|
title?: string
|
|
572
|
+
/**
|
|
573
|
+
* The absolute path of the page, with rewrites applied.
|
|
574
|
+
*/
|
|
200
575
|
path: string
|
|
576
|
+
/**
|
|
577
|
+
* The path of the page relative to the source directory, with rewrites
|
|
578
|
+
* applied.
|
|
579
|
+
*/
|
|
201
580
|
relativePath: string
|
|
581
|
+
/**
|
|
582
|
+
* Whether clean URLs are enabled.
|
|
583
|
+
*/
|
|
202
584
|
cleanUrls: boolean
|
|
585
|
+
/**
|
|
586
|
+
* Whether the rendered HTML is emitted at `relativePath`, so site-absolute
|
|
587
|
+
* links may be rewritten relative to it. Content loaders must not set it:
|
|
588
|
+
* their HTML is embedded in other pages.
|
|
589
|
+
* @internal
|
|
590
|
+
*/
|
|
591
|
+
relativizeUrls?: boolean
|
|
592
|
+
/**
|
|
593
|
+
* The URLs of the links collected from the page for the dead link check.
|
|
594
|
+
*/
|
|
203
595
|
links?: string[]
|
|
596
|
+
/**
|
|
597
|
+
* The line numbers at which each of `links` appears in the source.
|
|
598
|
+
*/
|
|
599
|
+
linkLines?: number[]
|
|
600
|
+
/**
|
|
601
|
+
* The absolute paths of the files inlined via `<!--@include-->` and
|
|
602
|
+
* imported via `<<<` code snippets, used for watch invalidation.
|
|
603
|
+
*/
|
|
204
604
|
includes?: string[]
|
|
605
|
+
/**
|
|
606
|
+
* The markdown source with includes expanded, set during rendering when
|
|
607
|
+
* include processing is enabled.
|
|
608
|
+
*/
|
|
609
|
+
src?: string
|
|
610
|
+
/**
|
|
611
|
+
* The absolute path of the actual source file on disk: the route template
|
|
612
|
+
* for dynamic routes, or the original file when rewrites are in use.
|
|
613
|
+
*/
|
|
205
614
|
realPath?: string
|
|
615
|
+
/**
|
|
616
|
+
* The key of the locale the page belongs to.
|
|
617
|
+
*/
|
|
206
618
|
localeIndex?: string
|
|
619
|
+
/**
|
|
620
|
+
* The expressions inlined by eager frontmatter interpolation while
|
|
621
|
+
* rendering, with the value each resolved to - used to detect values that
|
|
622
|
+
* `transformPageData` changes after the fact.
|
|
623
|
+
* @internal
|
|
624
|
+
*/
|
|
625
|
+
eagerInterpolations?: { expression: string; value: string }[]
|
|
207
626
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { useData } from '../composables/data'
|
|
3
|
-
import VPSwitchAppearance from './VPSwitchAppearance.vue'
|
|
4
|
-
|
|
5
|
-
const { site } = useData()
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<div
|
|
10
|
-
v-if="
|
|
11
|
-
site.appearance &&
|
|
12
|
-
site.appearance !== 'force-dark' &&
|
|
13
|
-
site.appearance !== 'force-auto'
|
|
14
|
-
"
|
|
15
|
-
class="VPNavBarAppearance"
|
|
16
|
-
>
|
|
17
|
-
<VPSwitchAppearance />
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<style scoped>
|
|
22
|
-
.VPNavBarAppearance {
|
|
23
|
-
display: none;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@media (min-width: 1280px) {
|
|
27
|
-
.VPNavBarAppearance {
|
|
28
|
-
display: flex;
|
|
29
|
-
align-items: center;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
</style>
|