@vuepress/theme-default 2.0.0-beta.27 → 2.0.0-beta.31
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 -57
- 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 +31 -29
- package/lib/client/components/PageNav.vue +14 -16
- package/lib/client/components/Sidebar.vue +6 -18
- package/lib/client/components/SidebarItem.vue +69 -0
- package/lib/client/components/SidebarItems.vue +16 -0
- 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/CodeGroupItem.vue +10 -10
- package/lib/client/components/global/{OutboundLink.vue → ExternalLinkIcon.vue} +7 -10
- package/lib/client/layouts/404.vue +12 -12
- package/lib/client/layouts/Layout.vue +54 -54
- package/lib/client/styles/{_wrapper.scss → _mixins.scss} +6 -1
- package/lib/client/styles/code.scss +2 -1
- package/lib/client/styles/dropdown.scss +2 -2
- package/lib/client/styles/layout.scss +2 -2
- package/lib/client/styles/normalize.scss +5 -0
- package/lib/client/styles/page.scss +11 -3
- package/lib/client/styles/sidebar.scss +61 -64
- package/lib/client/styles/vars.scss +5 -0
- package/lib/client/utils/index.d.ts +1 -0
- package/lib/client/utils/index.js +1 -0
- package/lib/client/utils/isActiveSidebarItem.d.ts +3 -0
- package/lib/client/utils/isActiveSidebarItem.js +20 -0
- package/lib/client/utils/resolveEditLink.d.ts +1 -1
- package/lib/client/utils/resolveEditLink.js +11 -6
- package/lib/node/defaultTheme.js +18 -3
- package/lib/node/utils/assignDefaultLocaleOptions.d.ts +3 -1
- package/lib/node/utils/assignDefaultLocaleOptions.js +5 -5
- package/lib/shared/nav.d.ts +9 -3
- package/lib/shared/options.d.ts +5 -1
- package/lib/shared/page.d.ts +2 -1
- package/package.json +20 -19
- package/lib/client/components/SidebarChild.d.ts +0 -6
- package/lib/client/components/SidebarChild.js +0 -76
|
@@ -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,
|
|
@@ -99,7 +71,7 @@ const useLastUpdated = (): ComputedRef<null | string> => {
|
|
|
99
71
|
|
|
100
72
|
const updatedDate = new Date(page.value.git?.updatedTime)
|
|
101
73
|
|
|
102
|
-
return updatedDate.toLocaleString(
|
|
74
|
+
return updatedDate.toLocaleString()
|
|
103
75
|
})
|
|
104
76
|
}
|
|
105
77
|
|
|
@@ -125,3 +97,33 @@ const editNavLink = useEditNavLink()
|
|
|
125
97
|
const lastUpdated = useLastUpdated()
|
|
126
98
|
const contributors = useContributors()
|
|
127
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,25 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import NavbarLinks from './NavbarLinks.vue'
|
|
3
|
+
import SidebarItems from './SidebarItems.vue'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
1
6
|
<template>
|
|
2
7
|
<aside class="sidebar">
|
|
3
8
|
<NavbarLinks />
|
|
4
|
-
|
|
5
9
|
<slot name="top" />
|
|
6
|
-
|
|
7
|
-
<ul class="sidebar-links">
|
|
8
|
-
<SidebarChild
|
|
9
|
-
v-for="item in sidebarItems"
|
|
10
|
-
:key="item.link || item.text"
|
|
11
|
-
:item="item"
|
|
12
|
-
/>
|
|
13
|
-
</ul>
|
|
14
|
-
|
|
10
|
+
<SidebarItems />
|
|
15
11
|
<slot name="bottom" />
|
|
16
12
|
</aside>
|
|
17
13
|
</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>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, toRefs } from 'vue'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
5
|
+
import type { ResolvedSidebarItem } from '../../shared'
|
|
6
|
+
import { isActiveSidebarItem } from '../utils'
|
|
7
|
+
import DropdownTransition from './DropdownTransition.vue'
|
|
8
|
+
import NavLink from './NavLink.vue'
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
item: {
|
|
12
|
+
type: Object as PropType<ResolvedSidebarItem>,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
depth: {
|
|
16
|
+
type: Number,
|
|
17
|
+
required: false,
|
|
18
|
+
default: 0,
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const { item, depth } = toRefs(props)
|
|
23
|
+
const route = useRoute()
|
|
24
|
+
const router = useRouter()
|
|
25
|
+
|
|
26
|
+
const isActive = computed(() => isActiveSidebarItem(item.value, route))
|
|
27
|
+
const itemClass = computed(() => ({
|
|
28
|
+
'sidebar-item': true,
|
|
29
|
+
'sidebar-heading': depth.value === 0,
|
|
30
|
+
'active': isActive.value,
|
|
31
|
+
'collapsible': item.value.collapsible,
|
|
32
|
+
}))
|
|
33
|
+
|
|
34
|
+
const isOpen = ref(true)
|
|
35
|
+
const onClick = ref<(() => void) | undefined>(undefined)
|
|
36
|
+
|
|
37
|
+
if (item.value.collapsible) {
|
|
38
|
+
// active item is open by default
|
|
39
|
+
isOpen.value = isActive.value
|
|
40
|
+
// toggle open status on click
|
|
41
|
+
onClick.value = () => {
|
|
42
|
+
isOpen.value = !isOpen.value
|
|
43
|
+
}
|
|
44
|
+
// reset open status after navigation
|
|
45
|
+
router.afterEach(() => {
|
|
46
|
+
isOpen.value = isActive.value
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<NavLink v-if="item.link" :class="itemClass" :item="item" />
|
|
53
|
+
<p v-else :class="itemClass" @click="onClick">
|
|
54
|
+
{{ item.text }}
|
|
55
|
+
<span
|
|
56
|
+
v-if="item.collapsible"
|
|
57
|
+
class="arrow"
|
|
58
|
+
:class="isOpen ? 'down' : 'right'"
|
|
59
|
+
/>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
<DropdownTransition v-if="item.children?.length">
|
|
63
|
+
<ul v-show="isOpen" class="sidebar-item-children">
|
|
64
|
+
<li v-for="child in item.children" :key="child.text">
|
|
65
|
+
<SidebarItem :item="child" :depth="depth + 1" />
|
|
66
|
+
</li>
|
|
67
|
+
</ul>
|
|
68
|
+
</DropdownTransition>
|
|
69
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useSidebarItems } from '../composables'
|
|
3
|
+
import SidebarItem from './SidebarItem.vue'
|
|
4
|
+
|
|
5
|
+
const sidebarItems = useSidebarItems()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<ul v-if="sidebarItems.length" class="sidebar-items">
|
|
10
|
+
<SidebarItem
|
|
11
|
+
v-for="item in sidebarItems"
|
|
12
|
+
:key="item.link || item.text"
|
|
13
|
+
:item="item"
|
|
14
|
+
/>
|
|
15
|
+
</ul>
|
|
16
|
+
</template>
|
|
@@ -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,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,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>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@import '_variables';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
@mixin content_wrapper {
|
|
4
4
|
max-width: var(--content-width);
|
|
5
5
|
margin: 0 auto;
|
|
6
6
|
padding: 2rem 2.5rem;
|
|
@@ -13,3 +13,8 @@
|
|
|
13
13
|
padding: 1.5rem;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
@mixin dropdown_wrapper {
|
|
18
|
+
transition: height 0.1s ease-out;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
@@ -125,7 +125,7 @@ pre[class*='language-'] {
|
|
|
125
125
|
pre,
|
|
126
126
|
pre[class*='language-'] {
|
|
127
127
|
line-height: 1.4;
|
|
128
|
-
padding: 1.
|
|
128
|
+
padding: 1.3rem 1.5rem;
|
|
129
129
|
margin: 0.85rem 0;
|
|
130
130
|
border-radius: 6px;
|
|
131
131
|
overflow: auto;
|
|
@@ -228,6 +228,7 @@ div[class*='language-'] {
|
|
|
228
228
|
z-index: 3;
|
|
229
229
|
user-select: none;
|
|
230
230
|
font-size: 0.85em;
|
|
231
|
+
line-height: 0;
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import '_mixins';
|
|
1
2
|
@import '_variables';
|
|
2
3
|
|
|
3
4
|
.dropdown-wrapper {
|
|
@@ -124,8 +125,7 @@
|
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
.nav-dropdown {
|
|
127
|
-
|
|
128
|
-
overflow: hidden;
|
|
128
|
+
@include dropdown_wrapper;
|
|
129
129
|
|
|
130
130
|
.dropdown-item {
|
|
131
131
|
.dropdown-subtitle {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
@import '_mixins';
|
|
1
2
|
@import '_variables';
|
|
2
|
-
@import '_wrapper';
|
|
3
3
|
|
|
4
4
|
.page {
|
|
5
5
|
padding-top: var(--navbar-height);
|
|
@@ -142,7 +142,7 @@ h6 {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.theme-default-content:not(.custom) {
|
|
145
|
-
@
|
|
145
|
+
@include content_wrapper;
|
|
146
146
|
|
|
147
147
|
padding-top: 0;
|
|
148
148
|
|
|
@@ -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);
|
|
@@ -81,6 +82,10 @@ h6 {
|
|
|
81
82
|
font-weight: 600;
|
|
82
83
|
line-height: 1.25;
|
|
83
84
|
|
|
85
|
+
&:focus-visible {
|
|
86
|
+
outline: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
84
89
|
&:hover .header-anchor {
|
|
85
90
|
opacity: 1;
|
|
86
91
|
}
|