@vuepress/theme-default 2.0.0-beta.24 → 2.0.0-beta.28

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.
@@ -1,5 +1,5 @@
1
- import { h } from 'vue';
2
1
  import { defineClientAppEnhance } from '@vuepress/client';
2
+ import { h } from 'vue';
3
3
  import Badge from './components/global/Badge.vue';
4
4
  import CodeGroup from './components/global/CodeGroup';
5
5
  import CodeGroupItem from './components/global/CodeGroupItem.vue';
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <main class="home" :aria-labelledby="heroText ? 'main-title' : undefined">
3
3
  <header class="hero">
4
- <img v-if="heroImage" :src="heroImage" :alt="heroAlt" />
4
+ <ClientOnly>
5
+ <img v-if="heroImage" :src="withBase(heroImage)" :alt="heroAlt" />
6
+ </ClientOnly>
5
7
 
6
8
  <h1 v-if="heroText" id="main-title">
7
9
  {{ heroText }}
@@ -42,26 +44,27 @@
42
44
  </template>
43
45
 
44
46
  <script setup lang="ts">
45
- import { computed } from 'vue'
46
47
  import {
47
48
  usePageFrontmatter,
48
49
  useSiteLocaleData,
49
50
  withBase,
50
51
  } from '@vuepress/client'
51
52
  import { isArray } from '@vuepress/shared'
53
+ import { computed } from 'vue'
52
54
  import type { DefaultThemeHomePageFrontmatter } from '../../shared'
55
+ import { useDarkMode } from '../composables'
53
56
  import NavLink from './NavLink.vue'
54
57
 
55
58
  const frontmatter = usePageFrontmatter<DefaultThemeHomePageFrontmatter>()
56
59
  const siteLocale = useSiteLocaleData()
60
+ const isDarkMode = useDarkMode()
57
61
 
58
62
  // hero image and title
59
63
  const heroImage = computed(() => {
60
- if (!frontmatter.value.heroImage) {
61
- return null
64
+ if (isDarkMode.value && frontmatter.value.heroImageDark !== undefined) {
65
+ return frontmatter.value.heroImageDark
62
66
  }
63
-
64
- return withBase(frontmatter.value.heroImage)
67
+ return frontmatter.value.heroImage
65
68
  })
66
69
  const heroText = computed(() => {
67
70
  if (frontmatter.value.heroText === null) {
@@ -28,6 +28,7 @@
28
28
  </template>
29
29
 
30
30
  <script lang="ts">
31
+ /* eslint-disable import/first, import/no-duplicates, import/order */
31
32
  import { defineComponent } from 'vue'
32
33
 
33
34
  export default defineComponent({
@@ -57,12 +58,12 @@ const { item } = toRefs(props)
57
58
  // if the link has http protocol
58
59
  const hasHttpProtocol = computed(() => isLinkHttp(item.value.link))
59
60
  // if the link has non-http protocol
60
- const hasNonHttpProtocal = computed(
61
+ const hasNonHttpProtocol = computed(
61
62
  () => isLinkMailto(item.value.link) || isLinkTel(item.value.link)
62
63
  )
63
64
  // resolve the `target` attr
64
65
  const linkTarget = computed(() => {
65
- if (hasNonHttpProtocal.value) return undefined
66
+ if (hasNonHttpProtocol.value) return undefined
66
67
  if (item.value.target) return item.value.target
67
68
  if (hasHttpProtocol.value) return '_blank'
68
69
  return undefined
@@ -72,11 +73,11 @@ const isBlankTarget = computed(() => linkTarget.value === '_blank')
72
73
  // is `<RouterLink>` or not
73
74
  const isRouterLink = computed(
74
75
  () =>
75
- !hasHttpProtocol.value && !hasNonHttpProtocal.value && !isBlankTarget.value
76
+ !hasHttpProtocol.value && !hasNonHttpProtocol.value && !isBlankTarget.value
76
77
  )
77
78
  // resolve the `rel` attr
78
79
  const linkRel = computed(() => {
79
- if (hasNonHttpProtocal.value) return undefined
80
+ if (hasNonHttpProtocol.value) return undefined
80
81
  if (item.value.rel) return item.value.rel
81
82
  if (isBlankTarget.value) return 'noopener noreferrer'
82
83
  return undefined
@@ -4,12 +4,15 @@
4
4
 
5
5
  <span ref="siteBrand">
6
6
  <RouterLink :to="siteBrandLink">
7
- <img
8
- v-if="siteBrandLogo"
9
- class="logo"
10
- :src="withBase(siteBrandLogo)"
11
- :alt="siteBrandTitle"
12
- />
7
+ <!-- logo could be different in dark mode, so we make it client-only to avoid ssr-mismatch -->
8
+ <ClientOnly>
9
+ <img
10
+ v-if="siteBrandLogo"
11
+ class="logo"
12
+ :src="withBase(siteBrandLogo)"
13
+ :alt="siteBrandTitle"
14
+ />
15
+ </ClientOnly>
13
16
 
14
17
  <span
15
18
  v-if="siteBrandTitle"
@@ -9,12 +9,12 @@
9
9
  </template>
10
10
 
11
11
  <script setup lang="ts">
12
+ import { useRouteLocale, useSiteLocaleData } from '@vuepress/client'
13
+ import { isLinkHttp, isString } from '@vuepress/shared'
12
14
  import { computed } from 'vue'
13
15
  import type { ComputedRef } from 'vue'
14
16
  import { useRouter } from 'vue-router'
15
- import { useRouteLocale, useSiteLocaleData } from '@vuepress/client'
16
- import { isLinkHttp, isString } from '@vuepress/shared'
17
- import type { NavbarItem, NavbarGroup, ResolvedNavbarItem } from '../../shared'
17
+ import type { NavbarGroup, NavbarItem, ResolvedNavbarItem } from '../../shared'
18
18
  import { useNavLink, useThemeLocaleData } from '../composables'
19
19
  import { resolveRepoType } from '../utils'
20
20
  import DropdownLink from './DropdownLink.vue'
@@ -6,7 +6,9 @@
6
6
 
7
7
  <div v-if="lastUpdated" class="meta-item last-updated">
8
8
  <span class="meta-item-label">{{ themeLocale.lastUpdatedText }}: </span>
9
- <span class="meta-item-info">{{ lastUpdated }}</span>
9
+ <ClientOnly>
10
+ <span class="meta-item-info">{{ lastUpdated }}</span>
11
+ </ClientOnly>
10
12
  </div>
11
13
 
12
14
  <div
@@ -27,16 +29,16 @@
27
29
  </template>
28
30
 
29
31
  <script setup lang="ts">
30
- import { computed } from 'vue'
31
- import type { ComputedRef } from 'vue'
32
32
  import {
33
33
  usePageData,
34
34
  usePageFrontmatter,
35
35
  useSiteLocaleData,
36
36
  } from '@vuepress/client'
37
+ import { computed } from 'vue'
38
+ import type { ComputedRef } from 'vue'
37
39
  import type {
38
- DefaultThemePageData,
39
40
  DefaultThemeNormalPageFrontmatter,
41
+ DefaultThemePageData,
40
42
  NavLink as NavLinkType,
41
43
  } from '../../shared'
42
44
  import { useThemeLocaleData } from '../composables'
@@ -70,7 +72,8 @@ const useEditNavLink = (): ComputedRef<null | NavLinkType> => {
70
72
  docsBranch,
71
73
  docsDir,
72
74
  filePathRelative: page.value.filePathRelative,
73
- editLinkPattern: themeLocale.value.editLinkPattern,
75
+ editLinkPattern:
76
+ frontmatter.value.editLinkPattern ?? themeLocale.value.editLinkPattern,
74
77
  })
75
78
 
76
79
  if (!editLink) return null
@@ -98,7 +101,7 @@ const useLastUpdated = (): ComputedRef<null | string> => {
98
101
 
99
102
  const updatedDate = new Date(page.value.git?.updatedTime)
100
103
 
101
- return updatedDate.toLocaleString(siteLocale.value.lang)
104
+ return updatedDate.toLocaleString()
102
105
  })
103
106
  }
104
107
 
@@ -2,23 +2,21 @@
2
2
  <nav v-if="prevNavLink || nextNavLink" class="page-nav">
3
3
  <p class="inner">
4
4
  <span v-if="prevNavLink" class="prev">
5
- ←
6
5
  <NavLink :item="prevNavLink" />
7
6
  </span>
8
7
 
9
8
  <span v-if="nextNavLink" class="next">
10
9
  <NavLink :item="nextNavLink" />
11
- →
12
10
  </span>
13
11
  </p>
14
12
  </nav>
15
13
  </template>
16
14
 
17
15
  <script setup lang="ts">
18
- import { computed } from 'vue'
19
- import { useRoute } from 'vue-router'
20
16
  import { usePageFrontmatter } from '@vuepress/client'
21
17
  import { isPlainObject, isString } from '@vuepress/shared'
18
+ import { computed } from 'vue'
19
+ import { useRoute } from 'vue-router'
22
20
  import type {
23
21
  DefaultThemeNormalPageFrontmatter,
24
22
  NavLink as NavLinkType,
@@ -1,5 +1,5 @@
1
1
  import type { VNode } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
3
  [key: string]: any;
4
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & ({} | {}), {}>;
4
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}>, {}>;
5
5
  export default _default;
@@ -6,7 +6,7 @@ export default defineComponent({
6
6
  const activeIndex = ref(-1);
7
7
  // refs of the tab buttons
8
8
  const tabRefs = ref([]);
9
- if (__DEV__) {
9
+ if (__VUEPRESS_DEV__) {
10
10
  // after removing a code-group-item, we need to clear the ref
11
11
  // of the removed item to avoid issues caused by HMR
12
12
  onBeforeUpdate(() => {
@@ -1,7 +1,7 @@
1
1
  import { usePreferredDark, useStorage } from '@vueuse/core';
2
2
  import { computed, inject, onMounted, onUnmounted, provide, watch } from 'vue';
3
3
  import { useThemeLocaleData } from '.';
4
- export const darkModeSymbol = Symbol(__DEV__ ? 'darkMode' : '');
4
+ export const darkModeSymbol = Symbol(__VUEPRESS_DEV__ ? 'darkMode' : '');
5
5
  /**
6
6
  * Inject dark mode global computed
7
7
  */
@@ -1,5 +1,5 @@
1
- import { useRouter } from 'vue-router';
2
1
  import { isFunction, isString } from '@vuepress/shared';
2
+ import { useRouter } from 'vue-router';
3
3
  /**
4
4
  * Resolve a route with redirection
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import type { PageHeader } from '@vuepress/client';
2
2
  import type { ComputedRef, InjectionKey } from 'vue';
3
- import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, SidebarConfigArray, SidebarConfigObject, ResolvedSidebarItem } from '../../shared';
3
+ import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, ResolvedSidebarItem, SidebarConfigArray, SidebarConfigObject } from '../../shared';
4
4
  export declare type SidebarItemsRef = ComputedRef<ResolvedSidebarItem[]>;
5
5
  export declare const sidebarItemsSymbol: InjectionKey<SidebarItemsRef>;
6
6
  /**
@@ -1,4 +1,4 @@
1
- import type { NavItem, NavGroup, NavLink, NavbarItem, NavbarGroup, NavbarConfig, ResolvedNavbarItem, SidebarItem, SidebarConfigArray, SidebarConfigObject, SidebarConfig, ResolvedSidebarItem, DefaultThemePluginsOptions, DefaultThemeLocaleOptions, DefaultThemeData, DefaultThemeLocaleData, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemeHomePageFrontmatter, DefaultThemeNormalPageFrontmatter } from '../shared';
1
+ import type { DefaultThemeData, DefaultThemeHomePageFrontmatter, DefaultThemeLocaleData, DefaultThemeLocaleOptions, DefaultThemeNormalPageFrontmatter, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemePluginsOptions, NavbarConfig, NavbarGroup, NavbarItem, NavGroup, NavItem, NavLink, ResolvedNavbarItem, ResolvedSidebarItem, SidebarConfig, SidebarConfigArray, SidebarConfigObject, SidebarItem } from '../shared';
2
2
  export type { NavItem, NavGroup, NavLink, NavbarItem, NavbarGroup, NavbarConfig, ResolvedNavbarItem, SidebarItem, SidebarConfigArray, SidebarConfigObject, SidebarConfig, ResolvedSidebarItem, DefaultThemePluginsOptions, DefaultThemeLocaleOptions, DefaultThemeData, DefaultThemeLocaleData, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemeHomePageFrontmatter, DefaultThemeNormalPageFrontmatter, };
3
3
  export * from './composables';
4
4
  export * from './utils';
@@ -5,25 +5,29 @@
5
5
  @touchstart="onTouchStart"
6
6
  @touchend="onTouchEnd"
7
7
  >
8
- <Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
9
- <template #before>
10
- <slot name="navbar-before" />
11
- </template>
12
- <template #after>
13
- <slot name="navbar-after" />
14
- </template>
15
- </Navbar>
8
+ <slot name="navbar">
9
+ <Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
10
+ <template #before>
11
+ <slot name="navbar-before" />
12
+ </template>
13
+ <template #after>
14
+ <slot name="navbar-after" />
15
+ </template>
16
+ </Navbar>
17
+ </slot>
16
18
 
17
19
  <div class="sidebar-mask" @click="toggleSidebar(false)" />
18
20
 
19
- <Sidebar>
20
- <template #top>
21
- <slot name="sidebar-top" />
22
- </template>
23
- <template #bottom>
24
- <slot name="sidebar-bottom" />
25
- </template>
26
- </Sidebar>
21
+ <slot name="sidebar">
22
+ <Sidebar>
23
+ <template #top>
24
+ <slot name="sidebar-top" />
25
+ </template>
26
+ <template #bottom>
27
+ <slot name="sidebar-bottom" />
28
+ </template>
29
+ </Sidebar>
30
+ </slot>
27
31
 
28
32
  <slot name="page">
29
33
  <Home v-if="frontmatter.home" />
@@ -49,13 +53,13 @@
49
53
  </template>
50
54
 
51
55
  <script setup lang="ts">
56
+ import { usePageData, usePageFrontmatter } from '@vuepress/client'
52
57
  import { computed, onMounted, onUnmounted, ref, Transition } from 'vue'
53
58
  import { useRouter } from 'vue-router'
54
- import { usePageData, usePageFrontmatter } from '@vuepress/client'
55
59
  import type { DefaultThemePageFrontmatter } from '../../shared'
56
60
  import Home from '../components/Home.vue'
57
- import Page from '../components/Page.vue'
58
61
  import Navbar from '../components/Navbar.vue'
62
+ import Page from '../components/Page.vue'
59
63
  import Sidebar from '../components/Sidebar.vue'
60
64
  import {
61
65
  useScrollPromise,
@@ -135,6 +135,7 @@ pre[class*='language-'] {
135
135
  padding: 0;
136
136
  background-color: transparent;
137
137
  border-radius: 0;
138
+ overflow-wrap: unset;
138
139
  -webkit-font-smoothing: auto;
139
140
  -moz-osx-font-smoothing: auto;
140
141
  }
@@ -26,6 +26,13 @@
26
26
  margin: 1.8rem auto;
27
27
  }
28
28
 
29
+ .actions {
30
+ display: flex;
31
+ flex-wrap: wrap;
32
+ gap: 1rem;
33
+ justify-content: center;
34
+ }
35
+
29
36
  .description {
30
37
  max-width: 35rem;
31
38
  font-size: 1.6rem;
@@ -43,10 +50,6 @@
43
50
  transition: background-color var(--t-color);
44
51
  box-sizing: border-box;
45
52
 
46
- &:not(:first-child) {
47
- margin-left: 1.5rem;
48
- }
49
-
50
53
  &.primary {
51
54
  color: var(--c-bg);
52
55
  background-color: var(--c-brand);
@@ -10,7 +10,6 @@
10
10
 
11
11
  .logo {
12
12
  height: var(--navbar-line-height);
13
- min-width: var(--navbar-line-height);
14
13
  margin-right: var(--navbar-padding-v);
15
14
  vertical-align: top;
16
15
  }
@@ -138,7 +137,7 @@
138
137
  height: 2px;
139
138
  border-radius: 2px;
140
139
  background-color: var(--c-text);
141
- transition: transform ease 0.3s;
140
+ transition: transform var(--t-transform);
142
141
 
143
142
  &:nth-child(2) {
144
143
  margin: 6px 0;
@@ -32,6 +32,7 @@ p a code {
32
32
 
33
33
  kbd {
34
34
  font-family: var(--font-family-code);
35
+ color: var(--c-text);
35
36
  background: var(--c-bg-lighter);
36
37
  border: solid 0.15rem var(--c-border-dark);
37
38
  border-bottom: solid 0.25rem var(--c-border-dark);
@@ -64,7 +64,15 @@
64
64
  overflow: auto;
65
65
  }
66
66
 
67
+ .prev {
68
+ a &:before {
69
+ content: '←';
70
+ }
71
+ }
67
72
  .next {
68
73
  float: right;
74
+ a &:after {
75
+ content: '→';
76
+ }
69
77
  }
70
78
  }
@@ -4,6 +4,6 @@ export declare const resolveEditLink: ({ docsRepo, docsBranch, docsDir, filePath
4
4
  docsRepo: string;
5
5
  docsBranch: string;
6
6
  docsDir: string;
7
- filePathRelative: string;
7
+ filePathRelative: string | null;
8
8
  editLinkPattern?: string | undefined;
9
9
  }) => string | null;
@@ -1,4 +1,4 @@
1
- import { isLinkHttp, removeLeadingSlash, removeEndingSlash, } from '@vuepress/shared';
1
+ import { isLinkHttp, removeEndingSlash, removeLeadingSlash, } from '@vuepress/shared';
2
2
  import { resolveRepoType } from './resolveRepoType';
3
3
  export const editLinkPatterns = {
4
4
  GitHub: ':repo/edit/:branch/:path',
@@ -6,15 +6,20 @@ export const editLinkPatterns = {
6
6
  Gitee: ':repo/edit/:branch/:path',
7
7
  Bitbucket: ':repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default',
8
8
  };
9
- export const resolveEditLink = ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }) => {
10
- const repoType = resolveRepoType(docsRepo);
11
- let pattern;
9
+ const resolveEditLinkPatterns = ({ docsRepo, editLinkPattern, }) => {
12
10
  if (editLinkPattern) {
13
- pattern = editLinkPattern;
11
+ return editLinkPattern;
14
12
  }
15
- else if (repoType !== null) {
16
- pattern = editLinkPatterns[repoType];
13
+ const repoType = resolveRepoType(docsRepo);
14
+ if (repoType !== null) {
15
+ return editLinkPatterns[repoType];
17
16
  }
17
+ return null;
18
+ };
19
+ export const resolveEditLink = ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }) => {
20
+ if (!filePathRelative)
21
+ return null;
22
+ const pattern = resolveEditLinkPatterns({ docsRepo, editLinkPattern });
18
23
  if (!pattern)
19
24
  return null;
20
25
  return pattern
@@ -3,47 +3,61 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultTheme = void 0;
4
4
  const utils_1 = require("@vuepress/utils");
5
5
  const utils_2 = require("./utils");
6
- const defaultTheme = ({ themePlugins = {}, ...localeOptions }) => {
7
- utils_2.assignDefaultLocaleOptions(localeOptions);
6
+ const defaultTheme = ({ themePlugins = {}, ...localeOptions }, app) => {
7
+ if (app.options.bundler.endsWith('vite')) {
8
+ // eslint-disable-next-line import/no-extraneous-dependencies
9
+ app.options.bundlerConfig.viteOptions = require('vite').mergeConfig(app.options.bundlerConfig.viteOptions, {
10
+ css: {
11
+ preprocessorOptions: {
12
+ scss: { charset: false },
13
+ },
14
+ },
15
+ });
16
+ }
17
+ (0, utils_2.assignDefaultLocaleOptions)(localeOptions);
8
18
  return {
9
19
  name: '@vuepress/theme-default',
10
20
  layouts: utils_1.path.resolve(__dirname, '../client/layouts'),
11
21
  clientAppEnhanceFiles: utils_1.path.resolve(__dirname, '../client/clientAppEnhance.js'),
12
22
  clientAppSetupFiles: utils_1.path.resolve(__dirname, '../client/clientAppSetup.js'),
13
- // use the relative file path to generate edit link
14
- extendsPageData: ({ filePathRelative }) => ({ filePathRelative }),
23
+ extendsPage: (page) => {
24
+ // save relative file path into page data to generate edit link
25
+ page.data.filePathRelative = page.filePathRelative;
26
+ // save title into route meta to generate navbar and sidebar
27
+ page.routeMeta.title = page.title;
28
+ },
15
29
  plugins: [
16
30
  [
17
31
  '@vuepress/active-header-links',
18
- utils_2.resolveActiveHeaderLinksPluginOptions(themePlugins),
32
+ (0, utils_2.resolveActiveHeaderLinksPluginOptions)(themePlugins),
19
33
  ],
20
34
  ['@vuepress/back-to-top', themePlugins.backToTop !== false],
21
35
  [
22
36
  '@vuepress/container',
23
- utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'tip'),
37
+ (0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'tip'),
24
38
  ],
25
39
  [
26
40
  '@vuepress/container',
27
- utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'warning'),
41
+ (0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'warning'),
28
42
  ],
29
43
  [
30
44
  '@vuepress/container',
31
- utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'danger'),
45
+ (0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'danger'),
32
46
  ],
33
47
  [
34
48
  '@vuepress/container',
35
- utils_2.resolveContainerPluginOptionsForDetails(themePlugins),
49
+ (0, utils_2.resolveContainerPluginOptionsForDetails)(themePlugins),
36
50
  ],
37
51
  [
38
52
  '@vuepress/container',
39
- utils_2.resolveContainerPluginOptionsForCodeGroup(themePlugins),
53
+ (0, utils_2.resolveContainerPluginOptionsForCodeGroup)(themePlugins),
40
54
  ],
41
55
  [
42
56
  '@vuepress/container',
43
- utils_2.resolveContainerPluginOptionsForCodeGroupItem(themePlugins),
57
+ (0, utils_2.resolveContainerPluginOptionsForCodeGroupItem)(themePlugins),
44
58
  ],
45
- ['@vuepress/git', utils_2.resolveGitPluginOptions(themePlugins, localeOptions)],
46
- ['@vuepress/medium-zoom', utils_2.resolveMediumZoomPluginOptions(themePlugins)],
59
+ ['@vuepress/git', (0, utils_2.resolveGitPluginOptions)(themePlugins, localeOptions)],
60
+ ['@vuepress/medium-zoom', (0, utils_2.resolveMediumZoomPluginOptions)(themePlugins)],
47
61
  ['@vuepress/nprogress', themePlugins.nprogress !== false],
48
62
  ['@vuepress/palette', { preset: 'sass' }],
49
63
  ['@vuepress/prismjs', themePlugins.prismjs !== false],
@@ -1,5 +1,5 @@
1
1
  import type { ContainerPluginOptions } from '@vuepress/plugin-container';
2
- import type { DefaultThemePluginsOptions, DefaultThemeData } from '../../shared';
2
+ import type { DefaultThemeData, DefaultThemePluginsOptions } from '../../shared';
3
3
  /**
4
4
  * Resolve options for @vuepress/plugin-container
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { GitPluginOptions } from '@vuepress/plugin-git';
2
- import type { DefaultThemePluginsOptions, DefaultThemeLocaleOptions } from '../../shared';
2
+ import type { DefaultThemeLocaleOptions, DefaultThemePluginsOptions } from '../../shared';
3
3
  /**
4
4
  * Resolve options for @vuepress/plugin-git
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { LocaleData } from '@vuepress/shared';
2
1
  import type { ThemeData } from '@vuepress/plugin-theme-data';
2
+ import type { LocaleData } from '@vuepress/shared';
3
3
  import type { NavbarConfig, SidebarConfig } from './nav';
4
4
  export interface DefaultThemePluginsOptions {
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import type { GitPluginPageData } from '@vuepress/plugin-git';
2
2
  import type { NavLink, SidebarConfig } from './nav';
3
3
  export interface DefaultThemePageData extends GitPluginPageData {
4
- filePathRelative: string;
4
+ filePathRelative: string | null;
5
5
  }
6
6
  export interface DefaultThemePageFrontmatter {
7
7
  home?: boolean;
@@ -11,6 +11,7 @@ export interface DefaultThemePageFrontmatter {
11
11
  export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontmatter {
12
12
  home: true;
13
13
  heroImage?: string;
14
+ heroImageDark?: string;
14
15
  heroAlt?: string;
15
16
  heroText?: string | null;
16
17
  tagline?: string | null;
@@ -29,6 +30,7 @@ export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontma
29
30
  export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
30
31
  home?: false;
31
32
  editLink?: boolean;
33
+ editLinkPattern?: string;
32
34
  lastUpdated?: boolean;
33
35
  contributors?: boolean;
34
36
  sidebar?: 'auto' | false | SidebarConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-beta.24",
3
+ "version": "2.0.0-beta.28",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -29,27 +29,27 @@
29
29
  "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
30
30
  },
31
31
  "dependencies": {
32
- "@vuepress/client": "2.0.0-beta.24",
33
- "@vuepress/core": "2.0.0-beta.24",
34
- "@vuepress/plugin-active-header-links": "2.0.0-beta.24",
35
- "@vuepress/plugin-back-to-top": "2.0.0-beta.24",
36
- "@vuepress/plugin-container": "2.0.0-beta.24",
37
- "@vuepress/plugin-git": "2.0.0-beta.24",
38
- "@vuepress/plugin-medium-zoom": "2.0.0-beta.24",
39
- "@vuepress/plugin-nprogress": "2.0.0-beta.24",
40
- "@vuepress/plugin-palette": "2.0.0-beta.24",
41
- "@vuepress/plugin-prismjs": "2.0.0-beta.24",
42
- "@vuepress/plugin-theme-data": "2.0.0-beta.24",
43
- "@vuepress/shared": "2.0.0-beta.24",
44
- "@vuepress/utils": "2.0.0-beta.24",
45
- "@vueuse/core": "^6.0.0-beta.3",
46
- "sass": "^1.37.5",
47
- "sass-loader": "^12.1.0",
48
- "vue": "^3.2.2",
49
- "vue-router": "^4.0.10"
32
+ "@vuepress/client": "2.0.0-beta.28",
33
+ "@vuepress/core": "2.0.0-beta.28",
34
+ "@vuepress/plugin-active-header-links": "2.0.0-beta.28",
35
+ "@vuepress/plugin-back-to-top": "2.0.0-beta.28",
36
+ "@vuepress/plugin-container": "2.0.0-beta.28",
37
+ "@vuepress/plugin-git": "2.0.0-beta.28",
38
+ "@vuepress/plugin-medium-zoom": "2.0.0-beta.28",
39
+ "@vuepress/plugin-nprogress": "2.0.0-beta.28",
40
+ "@vuepress/plugin-palette": "2.0.0-beta.28",
41
+ "@vuepress/plugin-prismjs": "2.0.0-beta.28",
42
+ "@vuepress/plugin-theme-data": "2.0.0-beta.28",
43
+ "@vuepress/shared": "2.0.0-beta.28",
44
+ "@vuepress/utils": "2.0.0-beta.28",
45
+ "@vueuse/core": "^7.1.2",
46
+ "sass": "^1.44.0",
47
+ "sass-loader": "^12.4.0",
48
+ "vue": "^3.2.24",
49
+ "vue-router": "^4.0.12"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "dd9588128c4b8e62bb96ed8581322e8901e22b90"
54
+ "gitHead": "71c34816a79263c7dcba3ff0c103e264abdbf0d2"
55
55
  }