@vuepress/theme-default 2.0.0-beta.26 → 2.0.0-beta.30
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/lib/client/clientAppEnhance.js +4 -5
- package/lib/client/components/DropdownLink.vue +51 -51
- package/lib/client/components/DropdownTransition.vue +11 -11
- package/lib/client/components/Home.vue +12 -107
- package/lib/client/components/HomeContent.vue +5 -0
- package/lib/client/components/HomeFeatures.vue +23 -0
- package/lib/client/components/HomeFooter.vue +17 -0
- package/lib/client/components/HomeHero.vue +97 -0
- package/lib/client/components/NavLink.vue +33 -33
- package/lib/client/components/Navbar.vue +23 -54
- package/lib/client/components/NavbarBrand.vue +55 -0
- package/lib/client/components/NavbarLinks.vue +16 -11
- package/lib/client/components/Page.vue +5 -5
- package/lib/client/components/PageMeta.vue +34 -31
- package/lib/client/components/PageNav.vue +14 -16
- package/lib/client/components/Sidebar.vue +8 -8
- package/lib/client/components/ToggleDarkModeButton.vue +11 -11
- package/lib/client/components/ToggleSidebarButton.vue +8 -8
- package/lib/client/components/global/Badge.vue +12 -12
- package/lib/client/components/global/CodeGroup.d.ts +1 -1
- package/lib/client/components/global/CodeGroupItem.vue +10 -10
- package/lib/client/components/global/{OutboundLink.vue → ExternalLinkIcon.vue} +7 -10
- package/lib/client/composables/useSidebarItems.d.ts +1 -1
- package/lib/client/index.d.ts +1 -1
- package/lib/client/layouts/404.vue +12 -12
- package/lib/client/layouts/Layout.vue +54 -54
- package/lib/client/styles/code.scss +1 -0
- package/lib/client/styles/home.scss +7 -4
- package/lib/client/styles/normalize.scss +1 -0
- package/lib/client/styles/page.scss +8 -0
- package/lib/client/styles/vars.scss +5 -0
- package/lib/client/utils/resolveEditLink.d.ts +1 -1
- package/lib/client/utils/resolveEditLink.js +12 -7
- package/lib/node/defaultTheme.js +28 -13
- package/lib/node/utils/assignDefaultLocaleOptions.d.ts +3 -1
- package/lib/node/utils/assignDefaultLocaleOptions.js +5 -5
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +1 -1
- package/lib/node/utils/resolveGitPluginOptions.d.ts +1 -1
- package/lib/shared/options.d.ts +5 -1
- package/lib/shared/page.d.ts +3 -1
- package/package.json +21 -20
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<nav v-if="navbarLinks.length" class="navbar-links">
|
|
3
|
-
<div v-for="item in navbarLinks" :key="item.text" class="navbar-links-item">
|
|
4
|
-
<DropdownLink v-if="item.children" :item="item" />
|
|
5
|
-
|
|
6
|
-
<NavLink v-else :item="item" />
|
|
7
|
-
</div>
|
|
8
|
-
</nav>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
1
|
<script setup lang="ts">
|
|
12
2
|
import { useRouteLocale, useSiteLocaleData } from '@vuepress/client'
|
|
13
3
|
import { isLinkHttp, isString } from '@vuepress/shared'
|
|
14
4
|
import { computed } from 'vue'
|
|
15
5
|
import type { ComputedRef } from 'vue'
|
|
16
6
|
import { useRouter } from 'vue-router'
|
|
17
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
NavbarGroup,
|
|
9
|
+
NavbarItem,
|
|
10
|
+
NavGroup,
|
|
11
|
+
NavLink as NavLinkType,
|
|
12
|
+
ResolvedNavbarItem,
|
|
13
|
+
} from '../../shared'
|
|
18
14
|
import { useNavLink, useThemeLocaleData } from '../composables'
|
|
19
15
|
import { resolveRepoType } from '../utils'
|
|
20
16
|
import DropdownLink from './DropdownLink.vue'
|
|
@@ -153,3 +149,12 @@ const navbarLinks = computed(() => [
|
|
|
153
149
|
...navbarRepo.value,
|
|
154
150
|
])
|
|
155
151
|
</script>
|
|
152
|
+
|
|
153
|
+
<template>
|
|
154
|
+
<nav v-if="navbarLinks.length" class="navbar-links">
|
|
155
|
+
<div v-for="item in navbarLinks" :key="item.text" class="navbar-links-item">
|
|
156
|
+
<DropdownLink v-if="item.children" :item="item" />
|
|
157
|
+
<NavLink v-else :item="item" />
|
|
158
|
+
</div>
|
|
159
|
+
</nav>
|
|
160
|
+
</template>
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PageMeta from './PageMeta.vue'
|
|
3
|
+
import PageNav from './PageNav.vue'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
1
6
|
<template>
|
|
2
7
|
<main class="page">
|
|
3
8
|
<slot name="top" />
|
|
@@ -13,8 +18,3 @@
|
|
|
13
18
|
<slot name="bottom" />
|
|
14
19
|
</main>
|
|
15
20
|
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import PageMeta from './PageMeta.vue'
|
|
19
|
-
import PageNav from './PageNav.vue'
|
|
20
|
-
</script>
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<footer class="page-meta">
|
|
3
|
-
<div v-if="editNavLink" class="meta-item edit-link">
|
|
4
|
-
<NavLink class="meta-item-label" :item="editNavLink" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<div v-if="lastUpdated" class="meta-item last-updated">
|
|
8
|
-
<span class="meta-item-label">{{ themeLocale.lastUpdatedText }}: </span>
|
|
9
|
-
<span class="meta-item-info">{{ lastUpdated }}</span>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div
|
|
13
|
-
v-if="contributors && contributors.length"
|
|
14
|
-
class="meta-item contributors"
|
|
15
|
-
>
|
|
16
|
-
<span class="meta-item-label">{{ themeLocale.contributorsText }}: </span>
|
|
17
|
-
<span class="meta-item-info">
|
|
18
|
-
<template v-for="(contributor, index) in contributors" :key="index">
|
|
19
|
-
<span class="contributor" :title="`email: ${contributor.email}`">
|
|
20
|
-
{{ contributor.name }}
|
|
21
|
-
</span>
|
|
22
|
-
<template v-if="index !== contributors.length - 1">, </template>
|
|
23
|
-
</template>
|
|
24
|
-
</span>
|
|
25
|
-
</div>
|
|
26
|
-
</footer>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
1
|
<script setup lang="ts">
|
|
30
2
|
import {
|
|
31
3
|
usePageData,
|
|
@@ -35,8 +7,8 @@ import {
|
|
|
35
7
|
import { computed } from 'vue'
|
|
36
8
|
import type { ComputedRef } from 'vue'
|
|
37
9
|
import type {
|
|
38
|
-
DefaultThemePageData,
|
|
39
10
|
DefaultThemeNormalPageFrontmatter,
|
|
11
|
+
DefaultThemePageData,
|
|
40
12
|
NavLink as NavLinkType,
|
|
41
13
|
} from '../../shared'
|
|
42
14
|
import { useThemeLocaleData } from '../composables'
|
|
@@ -70,7 +42,8 @@ const useEditNavLink = (): ComputedRef<null | NavLinkType> => {
|
|
|
70
42
|
docsBranch,
|
|
71
43
|
docsDir,
|
|
72
44
|
filePathRelative: page.value.filePathRelative,
|
|
73
|
-
editLinkPattern:
|
|
45
|
+
editLinkPattern:
|
|
46
|
+
frontmatter.value.editLinkPattern ?? themeLocale.value.editLinkPattern,
|
|
74
47
|
})
|
|
75
48
|
|
|
76
49
|
if (!editLink) return null
|
|
@@ -98,7 +71,7 @@ const useLastUpdated = (): ComputedRef<null | string> => {
|
|
|
98
71
|
|
|
99
72
|
const updatedDate = new Date(page.value.git?.updatedTime)
|
|
100
73
|
|
|
101
|
-
return updatedDate.toLocaleString(
|
|
74
|
+
return updatedDate.toLocaleString()
|
|
102
75
|
})
|
|
103
76
|
}
|
|
104
77
|
|
|
@@ -124,3 +97,33 @@ const editNavLink = useEditNavLink()
|
|
|
124
97
|
const lastUpdated = useLastUpdated()
|
|
125
98
|
const contributors = useContributors()
|
|
126
99
|
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<footer class="page-meta">
|
|
103
|
+
<div v-if="editNavLink" class="meta-item edit-link">
|
|
104
|
+
<NavLink class="meta-item-label" :item="editNavLink" />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div v-if="lastUpdated" class="meta-item last-updated">
|
|
108
|
+
<span class="meta-item-label">{{ themeLocale.lastUpdatedText }}: </span>
|
|
109
|
+
<ClientOnly>
|
|
110
|
+
<span class="meta-item-info">{{ lastUpdated }}</span>
|
|
111
|
+
</ClientOnly>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div
|
|
115
|
+
v-if="contributors && contributors.length"
|
|
116
|
+
class="meta-item contributors"
|
|
117
|
+
>
|
|
118
|
+
<span class="meta-item-label">{{ themeLocale.contributorsText }}: </span>
|
|
119
|
+
<span class="meta-item-info">
|
|
120
|
+
<template v-for="(contributor, index) in contributors" :key="index">
|
|
121
|
+
<span class="contributor" :title="`email: ${contributor.email}`">
|
|
122
|
+
{{ contributor.name }}
|
|
123
|
+
</span>
|
|
124
|
+
<template v-if="index !== contributors.length - 1">, </template>
|
|
125
|
+
</template>
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
</footer>
|
|
129
|
+
</template>
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<nav v-if="prevNavLink || nextNavLink" class="page-nav">
|
|
3
|
-
<p class="inner">
|
|
4
|
-
<span v-if="prevNavLink" class="prev">
|
|
5
|
-
←
|
|
6
|
-
<NavLink :item="prevNavLink" />
|
|
7
|
-
</span>
|
|
8
|
-
|
|
9
|
-
<span v-if="nextNavLink" class="next">
|
|
10
|
-
<NavLink :item="nextNavLink" />
|
|
11
|
-
→
|
|
12
|
-
</span>
|
|
13
|
-
</p>
|
|
14
|
-
</nav>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
1
|
<script setup lang="ts">
|
|
18
2
|
import { usePageFrontmatter } from '@vuepress/client'
|
|
19
3
|
import { isPlainObject, isString } from '@vuepress/shared'
|
|
@@ -103,3 +87,17 @@ const nextNavLink = computed(() => {
|
|
|
103
87
|
return resolveFromSidebarItems(sidebarItems.value, route.path, 1)
|
|
104
88
|
})
|
|
105
89
|
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<nav v-if="prevNavLink || nextNavLink" class="page-nav">
|
|
93
|
+
<p class="inner">
|
|
94
|
+
<span v-if="prevNavLink" class="prev">
|
|
95
|
+
<NavLink :item="prevNavLink" />
|
|
96
|
+
</span>
|
|
97
|
+
|
|
98
|
+
<span v-if="nextNavLink" class="next">
|
|
99
|
+
<NavLink :item="nextNavLink" />
|
|
100
|
+
</span>
|
|
101
|
+
</p>
|
|
102
|
+
</nav>
|
|
103
|
+
</template>
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useSidebarItems } from '../composables'
|
|
3
|
+
import NavbarLinks from './NavbarLinks.vue'
|
|
4
|
+
import { SidebarChild } from './SidebarChild'
|
|
5
|
+
|
|
6
|
+
const sidebarItems = useSidebarItems()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
1
9
|
<template>
|
|
2
10
|
<aside class="sidebar">
|
|
3
11
|
<NavbarLinks />
|
|
@@ -15,11 +23,3 @@
|
|
|
15
23
|
<slot name="bottom" />
|
|
16
24
|
</aside>
|
|
17
25
|
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { useSidebarItems } from '../composables'
|
|
21
|
-
import NavbarLinks from './NavbarLinks.vue'
|
|
22
|
-
import { SidebarChild } from './SidebarChild'
|
|
23
|
-
|
|
24
|
-
const sidebarItems = useSidebarItems()
|
|
25
|
-
</script>
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useDarkMode, useThemeLocaleData } from '../composables'
|
|
3
|
+
|
|
4
|
+
const themeLocale = useThemeLocaleData()
|
|
5
|
+
const isDarkMode = useDarkMode()
|
|
6
|
+
|
|
7
|
+
const toggleDarkMode = (): void => {
|
|
8
|
+
isDarkMode.value = !isDarkMode.value
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
1
12
|
<template>
|
|
2
13
|
<button
|
|
3
14
|
class="toggle-dark-button"
|
|
@@ -44,14 +55,3 @@
|
|
|
44
55
|
</svg>
|
|
45
56
|
</button>
|
|
46
57
|
</template>
|
|
47
|
-
|
|
48
|
-
<script setup lang="ts">
|
|
49
|
-
import { useDarkMode, useThemeLocaleData } from '../composables'
|
|
50
|
-
|
|
51
|
-
const themeLocale = useThemeLocaleData()
|
|
52
|
-
const isDarkMode = useDarkMode()
|
|
53
|
-
|
|
54
|
-
const toggleDarkMode = (): void => {
|
|
55
|
-
isDarkMode.value = !isDarkMode.value
|
|
56
|
-
}
|
|
57
|
-
</script>
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useThemeLocaleData } from '../composables'
|
|
3
|
+
|
|
4
|
+
defineEmits(['toggle'])
|
|
5
|
+
|
|
6
|
+
const themeLocale = useThemeLocaleData()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
1
9
|
<template>
|
|
2
10
|
<div
|
|
3
11
|
class="toggle-sidebar-button"
|
|
@@ -14,11 +22,3 @@
|
|
|
14
22
|
</div>
|
|
15
23
|
</div>
|
|
16
24
|
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { useThemeLocaleData } from '../composables'
|
|
20
|
-
|
|
21
|
-
defineEmits(['toggle'])
|
|
22
|
-
|
|
23
|
-
const themeLocale = useThemeLocaleData()
|
|
24
|
-
</script>
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span
|
|
3
|
-
class="badge"
|
|
4
|
-
:class="type"
|
|
5
|
-
:style="{
|
|
6
|
-
verticalAlign: vertical,
|
|
7
|
-
}"
|
|
8
|
-
>
|
|
9
|
-
<slot>{{ text }}</slot>
|
|
10
|
-
</span>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
1
|
<script setup lang="ts">
|
|
14
2
|
defineProps({
|
|
15
3
|
type: {
|
|
@@ -29,3 +17,15 @@ defineProps({
|
|
|
29
17
|
},
|
|
30
18
|
})
|
|
31
19
|
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<span
|
|
23
|
+
class="badge"
|
|
24
|
+
:class="type"
|
|
25
|
+
:style="{
|
|
26
|
+
verticalAlign: vertical,
|
|
27
|
+
}"
|
|
28
|
+
>
|
|
29
|
+
<slot>{{ text }}</slot>
|
|
30
|
+
</span>
|
|
31
|
+
</template>
|
|
@@ -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;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="code-group-item"
|
|
4
|
-
:class="{ 'code-group-item__active': active }"
|
|
5
|
-
:aria-selected="active"
|
|
6
|
-
>
|
|
7
|
-
<slot />
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
1
|
<script lang="ts">
|
|
12
2
|
import { defineComponent } from 'vue'
|
|
13
3
|
|
|
@@ -29,3 +19,13 @@ defineProps({
|
|
|
29
19
|
},
|
|
30
20
|
})
|
|
31
21
|
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div
|
|
25
|
+
class="code-group-item"
|
|
26
|
+
:class="{ 'code-group-item__active': active }"
|
|
27
|
+
:aria-selected="active"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<RawOutboundLink>
|
|
3
|
-
<span class="sr-only">{{ themeLocale.openInNewWindow }}</span>
|
|
4
|
-
</RawOutboundLink>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
1
|
<script setup lang="ts">
|
|
8
|
-
|
|
9
|
-
* Override the built-in `<OutboundLink>` for a11y
|
|
10
|
-
*/
|
|
11
|
-
import { OutboundLink as RawOutboundLink } from '@vuepress/client'
|
|
2
|
+
import { ExternalLinkIcon as RawExternalLinkIcon } from '@vuepress/plugin-external-link-icon/lib/client'
|
|
12
3
|
import { useThemeLocaleData } from '../../composables'
|
|
13
4
|
|
|
14
5
|
const themeLocale = useThemeLocaleData()
|
|
15
6
|
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<RawExternalLinkIcon>
|
|
10
|
+
<span class="sr-only">{{ themeLocale.openInNewWindow }}</span>
|
|
11
|
+
</RawExternalLinkIcon>
|
|
12
|
+
</template>
|
|
@@ -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
|
|
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
|
/**
|
package/lib/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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';
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="theme-container">
|
|
3
|
-
<div class="theme-default-content">
|
|
4
|
-
<h1>404</h1>
|
|
5
|
-
|
|
6
|
-
<blockquote>{{ getMsg() }}</blockquote>
|
|
7
|
-
|
|
8
|
-
<RouterLink :to="homeLink">{{ homeText }}</RouterLink>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
1
|
<script setup lang="ts">
|
|
14
2
|
import { useRouteLocale } from '@vuepress/client'
|
|
15
3
|
import { useThemeLocaleData } from '../composables'
|
|
@@ -23,3 +11,15 @@ const getMsg = (): string =>
|
|
|
23
11
|
const homeLink = themeLocale.value.home ?? routeLocale.value
|
|
24
12
|
const homeText = themeLocale.value.backToHome ?? 'Back to home'
|
|
25
13
|
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="theme-container">
|
|
17
|
+
<div class="theme-default-content">
|
|
18
|
+
<h1>404</h1>
|
|
19
|
+
|
|
20
|
+
<blockquote>{{ getMsg() }}</blockquote>
|
|
21
|
+
|
|
22
|
+
<RouterLink :to="homeLink">{{ homeText }}</RouterLink>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -1,57 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="theme-container"
|
|
4
|
-
:class="containerClass"
|
|
5
|
-
@touchstart="onTouchStart"
|
|
6
|
-
@touchend="onTouchEnd"
|
|
7
|
-
>
|
|
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>
|
|
18
|
-
|
|
19
|
-
<div class="sidebar-mask" @click="toggleSidebar(false)" />
|
|
20
|
-
|
|
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>
|
|
31
|
-
|
|
32
|
-
<slot name="page">
|
|
33
|
-
<Home v-if="frontmatter.home" />
|
|
34
|
-
|
|
35
|
-
<Transition
|
|
36
|
-
v-else
|
|
37
|
-
name="fade-slide-y"
|
|
38
|
-
mode="out-in"
|
|
39
|
-
@before-enter="onBeforeEnter"
|
|
40
|
-
@before-leave="onBeforeLeave"
|
|
41
|
-
>
|
|
42
|
-
<Page :key="page.path">
|
|
43
|
-
<template #top>
|
|
44
|
-
<slot name="page-top" />
|
|
45
|
-
</template>
|
|
46
|
-
<template #bottom>
|
|
47
|
-
<slot name="page-bottom" />
|
|
48
|
-
</template>
|
|
49
|
-
</Page>
|
|
50
|
-
</Transition>
|
|
51
|
-
</slot>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
1
|
<script setup lang="ts">
|
|
56
2
|
import { usePageData, usePageFrontmatter } from '@vuepress/client'
|
|
57
3
|
import { computed, onMounted, onUnmounted, ref, Transition } from 'vue'
|
|
@@ -126,3 +72,57 @@ const scrollPromise = useScrollPromise()
|
|
|
126
72
|
const onBeforeEnter = scrollPromise.resolve
|
|
127
73
|
const onBeforeLeave = scrollPromise.pending
|
|
128
74
|
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<div
|
|
78
|
+
class="theme-container"
|
|
79
|
+
:class="containerClass"
|
|
80
|
+
@touchstart="onTouchStart"
|
|
81
|
+
@touchend="onTouchEnd"
|
|
82
|
+
>
|
|
83
|
+
<slot name="navbar">
|
|
84
|
+
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
|
|
85
|
+
<template #before>
|
|
86
|
+
<slot name="navbar-before" />
|
|
87
|
+
</template>
|
|
88
|
+
<template #after>
|
|
89
|
+
<slot name="navbar-after" />
|
|
90
|
+
</template>
|
|
91
|
+
</Navbar>
|
|
92
|
+
</slot>
|
|
93
|
+
|
|
94
|
+
<div class="sidebar-mask" @click="toggleSidebar(false)" />
|
|
95
|
+
|
|
96
|
+
<slot name="sidebar">
|
|
97
|
+
<Sidebar>
|
|
98
|
+
<template #top>
|
|
99
|
+
<slot name="sidebar-top" />
|
|
100
|
+
</template>
|
|
101
|
+
<template #bottom>
|
|
102
|
+
<slot name="sidebar-bottom" />
|
|
103
|
+
</template>
|
|
104
|
+
</Sidebar>
|
|
105
|
+
</slot>
|
|
106
|
+
|
|
107
|
+
<slot name="page">
|
|
108
|
+
<Home v-if="frontmatter.home" />
|
|
109
|
+
|
|
110
|
+
<Transition
|
|
111
|
+
v-else
|
|
112
|
+
name="fade-slide-y"
|
|
113
|
+
mode="out-in"
|
|
114
|
+
@before-enter="onBeforeEnter"
|
|
115
|
+
@before-leave="onBeforeLeave"
|
|
116
|
+
>
|
|
117
|
+
<Page :key="page.path">
|
|
118
|
+
<template #top>
|
|
119
|
+
<slot name="page-top" />
|
|
120
|
+
</template>
|
|
121
|
+
<template #bottom>
|
|
122
|
+
<slot name="page-bottom" />
|
|
123
|
+
</template>
|
|
124
|
+
</Page>
|
|
125
|
+
</Transition>
|
|
126
|
+
</slot>
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
@@ -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);
|
|
@@ -95,6 +95,11 @@
|
|
|
95
95
|
--docsearch-footer-background: var(--c-bg);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
// plugin-external-link-icon
|
|
99
|
+
.external-link-icon {
|
|
100
|
+
--external-link-icon-color: var(--c-text-quote);
|
|
101
|
+
}
|
|
102
|
+
|
|
98
103
|
// plugin-medium-zoom
|
|
99
104
|
.medium-zoom-overlay {
|
|
100
105
|
--medium-zoom-bg-color: var(--c-bg);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isLinkHttp,
|
|
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
|
-
|
|
10
|
-
const repoType = resolveRepoType(docsRepo);
|
|
11
|
-
let pattern;
|
|
9
|
+
const resolveEditLinkPatterns = ({ docsRepo, editLinkPattern, }) => {
|
|
12
10
|
if (editLinkPattern) {
|
|
13
|
-
|
|
11
|
+
return editLinkPattern;
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
|
|
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
|