@vuepress/theme-default 2.0.0-rc.11 → 2.0.0-rc.111

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.
Files changed (142) hide show
  1. package/lib/client/components/VPAutoLink.vue +32 -0
  2. package/lib/client/components/VPDarkIcon.vue +8 -0
  3. package/lib/client/components/VPDropdownTransition.vue +43 -0
  4. package/lib/client/components/VPEditIcon.vue +12 -0
  5. package/lib/client/components/VPFadeSlideYTransition.vue +23 -0
  6. package/lib/client/components/VPHome.vue +37 -0
  7. package/lib/client/components/VPHomeFeatures.vue +65 -0
  8. package/lib/client/components/VPHomeFooter.vue +30 -0
  9. package/lib/client/components/VPHomeHero.vue +186 -0
  10. package/lib/client/components/VPLightIcon.vue +28 -0
  11. package/lib/client/components/VPNavbar.vue +138 -0
  12. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +39 -15
  13. package/lib/client/components/VPNavbarDropdown.vue +329 -0
  14. package/lib/client/components/VPNavbarItems.vue +111 -0
  15. package/lib/client/components/VPPage.vue +69 -0
  16. package/lib/client/components/VPPageMeta.vue +139 -0
  17. package/lib/client/components/VPPageNav.vue +123 -0
  18. package/lib/client/components/VPSidebar.vue +120 -0
  19. package/lib/client/components/VPSidebarItem.vue +185 -0
  20. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +27 -7
  21. package/lib/client/components/VPToggleColorModeButton.vue +55 -0
  22. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  23. package/lib/client/components/global/Badge.vue +83 -22
  24. package/lib/client/components/global/index.d.ts +1 -3
  25. package/lib/client/components/global/index.js +1 -3
  26. package/lib/client/composables/index.d.ts +7 -1
  27. package/lib/client/composables/index.js +7 -1
  28. package/lib/client/composables/useDarkMode.d.ts +1 -3
  29. package/lib/client/composables/useDarkMode.js +20 -17
  30. package/lib/client/composables/useData.d.ts +8 -0
  31. package/lib/client/composables/useData.js +7 -0
  32. package/lib/client/composables/useEditLink.d.ts +3 -0
  33. package/lib/client/composables/useEditLink.js +28 -0
  34. package/lib/client/composables/useHeaders.d.ts +9 -0
  35. package/lib/client/composables/useHeaders.js +38 -0
  36. package/lib/client/composables/useNavbarConfig.d.ts +3 -0
  37. package/lib/client/composables/useNavbarConfig.js +29 -0
  38. package/lib/client/composables/useNavbarRepo.d.ts +6 -0
  39. package/lib/client/composables/useNavbarRepo.js +38 -0
  40. package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
  41. package/lib/client/composables/useNavbarSelectLanguage.js +59 -0
  42. package/lib/client/composables/useNavigate.d.ts +1 -0
  43. package/lib/client/composables/useNavigate.js +22 -0
  44. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  45. package/lib/client/composables/useRelatedLinks.js +90 -0
  46. package/lib/client/composables/useScrollPromise.js +3 -1
  47. package/lib/client/composables/useSidebarItems.d.ts +21 -20
  48. package/lib/client/composables/useSidebarItems.js +96 -85
  49. package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
  50. package/lib/client/composables/useUpdateDeviceStatus.js +10 -5
  51. package/lib/client/config.d.ts +3 -2
  52. package/lib/client/config.js +8 -23
  53. package/lib/client/index.d.ts +1 -0
  54. package/lib/client/layouts/Layout.vue +126 -56
  55. package/lib/client/layouts/NotFound.vue +59 -12
  56. package/lib/client/shim.d.ts +6 -5
  57. package/lib/client/styles/_mixins.scss +4 -4
  58. package/lib/client/styles/_variables.module.scss +1 -1
  59. package/lib/client/styles/_variables.scss +2 -1
  60. package/lib/client/styles/arrow.scss +24 -22
  61. package/lib/client/styles/code-group.scss +34 -30
  62. package/lib/client/styles/content/code.scss +43 -0
  63. package/lib/client/styles/content/index.scss +3 -0
  64. package/lib/client/styles/content/normalize.scss +39 -0
  65. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  66. package/lib/client/styles/external-link-icon.scss +36 -0
  67. package/lib/client/styles/index.scss +3 -13
  68. package/lib/client/styles/layout.scss +5 -197
  69. package/lib/client/styles/normalize.scss +1 -194
  70. package/lib/client/styles/plugins.scss +28 -0
  71. package/lib/client/styles/vars-dark.scss +20 -58
  72. package/lib/client/styles/vars.scss +54 -150
  73. package/lib/client/typings.d.ts +13 -0
  74. package/lib/client/typings.js +1 -0
  75. package/lib/client/utils/index.d.ts +2 -1
  76. package/lib/client/utils/index.js +2 -1
  77. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
  78. package/lib/client/utils/isActiveSidebarItem.js +1 -1
  79. package/lib/client/utils/resolveAutoLink.d.ts +9 -0
  80. package/lib/client/utils/{getNavLink.js → resolveAutoLink.js} +3 -3
  81. package/lib/client/utils/resolveEditLink.d.ts +3 -3
  82. package/lib/client/utils/resolveEditLink.js +3 -3
  83. package/lib/client/utils/resolvePrefix.d.ts +1 -0
  84. package/lib/client/utils/resolvePrefix.js +4 -0
  85. package/lib/client/utils/resolveRepoType.d.ts +1 -1
  86. package/lib/client/utils/resolveRepoType.js +4 -4
  87. package/lib/node/defaultTheme.d.ts +2 -1
  88. package/lib/node/defaultTheme.js +57 -64
  89. package/lib/node/index.d.ts +1 -3
  90. package/lib/node/index.js +0 -3
  91. package/lib/node/typings.d.ts +59 -0
  92. package/lib/node/typings.js +1 -0
  93. package/lib/node/utils/assignDefaultLocaleOptions.js +3 -8
  94. package/lib/node/utils/index.d.ts +1 -1
  95. package/lib/node/utils/index.js +1 -1
  96. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
  97. package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
  98. package/lib/shared/index.d.ts +5 -3
  99. package/lib/shared/index.js +1 -3
  100. package/lib/shared/nav.d.ts +19 -30
  101. package/lib/shared/navbar.d.ts +21 -0
  102. package/lib/shared/navbar.js +1 -0
  103. package/lib/shared/options.d.ts +36 -66
  104. package/lib/shared/page.d.ts +9 -6
  105. package/lib/shared/sidebar.d.ts +26 -0
  106. package/lib/shared/sidebar.js +1 -0
  107. package/package.json +34 -27
  108. package/templates/build.html +16 -10
  109. package/lib/client/components/AutoLink.vue +0 -113
  110. package/lib/client/components/DropdownTransition.vue +0 -25
  111. package/lib/client/components/Home.vue +0 -15
  112. package/lib/client/components/HomeContent.vue +0 -5
  113. package/lib/client/components/HomeFeatures.vue +0 -22
  114. package/lib/client/components/HomeFooter.vue +0 -17
  115. package/lib/client/components/HomeHero.vue +0 -97
  116. package/lib/client/components/Navbar.vue +0 -79
  117. package/lib/client/components/NavbarDropdown.vue +0 -126
  118. package/lib/client/components/NavbarItems.vue +0 -194
  119. package/lib/client/components/Page.vue +0 -31
  120. package/lib/client/components/PageMeta.vue +0 -124
  121. package/lib/client/components/PageNav.vue +0 -122
  122. package/lib/client/components/Sidebar.vue +0 -18
  123. package/lib/client/components/SidebarItem.vue +0 -87
  124. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  125. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  126. package/lib/client/components/global/CodeGroup.d.ts +0 -6
  127. package/lib/client/components/global/CodeGroup.js +0 -120
  128. package/lib/client/components/global/CodeGroupItem.vue +0 -27
  129. package/lib/client/composables/useThemeData.d.ts +0 -4
  130. package/lib/client/composables/useThemeData.js +0 -3
  131. package/lib/client/styles/badge.scss +0 -36
  132. package/lib/client/styles/code.scss +0 -263
  133. package/lib/client/styles/custom-container.scss +0 -142
  134. package/lib/client/styles/home.scss +0 -168
  135. package/lib/client/styles/navbar-dropdown.scss +0 -183
  136. package/lib/client/styles/navbar.scss +0 -197
  137. package/lib/client/styles/page.scss +0 -87
  138. package/lib/client/styles/sidebar.scss +0 -134
  139. package/lib/client/styles/transitions.scss +0 -22
  140. package/lib/client/utils/getNavLink.d.ts +0 -9
  141. package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
  142. package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
@@ -0,0 +1,329 @@
1
+ <script setup lang="ts">
2
+ import VPAutoLink from '@theme/VPAutoLink.vue'
3
+ import { FadeInExpandTransition } from '@vuepress/helper/client'
4
+ import { useToggle } from '@vueuse/core'
5
+ import { computed } from 'vue'
6
+ import { onContentUpdated } from 'vuepress/client'
7
+ import type { AutoLinkOptions, NavGroup } from '../../shared/index.js'
8
+
9
+ import '@vuepress/helper/transition/fade-in-height-expand.css'
10
+
11
+ const { config } = defineProps<{
12
+ /** dropdown config */
13
+ config: NavGroup<AutoLinkOptions | NavGroup<AutoLinkOptions>>
14
+ }>()
15
+
16
+ const [open, toggleOpen] = useToggle()
17
+
18
+ const dropdownAriaLabel = computed(() => config.ariaLabel || config.text)
19
+
20
+ const isLastItemOfArray = (arrayItem: unknown, array: unknown[]): boolean =>
21
+ array[array.length - 1] === arrayItem
22
+
23
+ /**
24
+ * Open the dropdown when user tab and click from keyboard.
25
+ *
26
+ * Use event.detail to detect tab and click from keyboard.
27
+ * The Tab + Click is UIEvent > KeyboardEvent, so the detail is 0.
28
+ *
29
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
30
+ */
31
+ const handleDropdown = (e: UIEvent): void => {
32
+ if (e.detail === 0) toggleOpen()
33
+ else toggleOpen(false)
34
+ }
35
+
36
+ onContentUpdated(() => {
37
+ toggleOpen(false)
38
+ })
39
+ </script>
40
+
41
+ <template>
42
+ <div class="vp-navbar-dropdown-wrapper" :class="{ open }">
43
+ <button
44
+ class="vp-navbar-dropdown-title"
45
+ type="button"
46
+ :aria-label="dropdownAriaLabel"
47
+ @click="handleDropdown"
48
+ >
49
+ <span class="title">{{ config.text }}</span>
50
+ <span class="arrow down" />
51
+ </button>
52
+
53
+ <button
54
+ class="vp-navbar-dropdown-title-mobile"
55
+ type="button"
56
+ :aria-label="dropdownAriaLabel"
57
+ @click="() => toggleOpen()"
58
+ >
59
+ <span class="title">{{ config.text }}</span>
60
+ <span class="arrow" :class="open ? 'down' : 'right'" />
61
+ </button>
62
+
63
+ <FadeInExpandTransition>
64
+ <ul v-show="open" class="vp-navbar-dropdown">
65
+ <li
66
+ v-for="child in config.children"
67
+ :key="child.text"
68
+ class="vp-navbar-dropdown-item"
69
+ >
70
+ <template v-if="'children' in child">
71
+ <h4 class="vp-navbar-dropdown-subtitle">
72
+ <VPAutoLink
73
+ v-if="child.link"
74
+ :config="child"
75
+ @focusout="
76
+ () => {
77
+ if (
78
+ isLastItemOfArray(child, config.children) &&
79
+ child.children.length === 0
80
+ ) {
81
+ open = false
82
+ }
83
+ }
84
+ "
85
+ />
86
+
87
+ <span v-else>{{ child.text }}</span>
88
+ </h4>
89
+
90
+ <ul class="vp-navbar-dropdown-subitem-wrapper">
91
+ <li
92
+ v-for="grandchild in child.children"
93
+ :key="grandchild.link"
94
+ class="vp-navbar-dropdown-subitem"
95
+ >
96
+ <VPAutoLink
97
+ :config="grandchild"
98
+ @focusout="
99
+ () => {
100
+ if (
101
+ isLastItemOfArray(grandchild, child.children) &&
102
+ isLastItemOfArray(child, config.children)
103
+ ) {
104
+ toggleOpen(false)
105
+ }
106
+ }
107
+ "
108
+ />
109
+ </li>
110
+ </ul>
111
+ </template>
112
+
113
+ <template v-else>
114
+ <VPAutoLink
115
+ :config="child"
116
+ @focusout="
117
+ () => {
118
+ if (isLastItemOfArray(child, config.children)) {
119
+ toggleOpen(false)
120
+ }
121
+ }
122
+ "
123
+ />
124
+ </template>
125
+ </li>
126
+ </ul>
127
+ </FadeInExpandTransition>
128
+ </div>
129
+ </template>
130
+
131
+ <style lang="scss">
132
+ @use '../styles/mixins';
133
+ @use '../styles/variables' as *;
134
+
135
+ .vp-navbar-dropdown-wrapper {
136
+ cursor: pointer;
137
+
138
+ &:not(.mobile) {
139
+ height: 1.8rem;
140
+
141
+ &:hover,
142
+ &.open {
143
+ .vp-navbar-dropdown {
144
+ // override the inline style.
145
+ display: block !important;
146
+ }
147
+ }
148
+ }
149
+ }
150
+
151
+ .vp-navbar-dropdown {
152
+ .vp-navbar-dropdown-wrapper.mobile & {
153
+ @include mixins.dropdown-wrapper;
154
+
155
+ padding-top: 0.5rem;
156
+ }
157
+
158
+ .vp-navbar-dropdown-wrapper:not(.mobile) & {
159
+ position: absolute;
160
+ inset-inline-end: 0;
161
+ top: 100%;
162
+
163
+ display: none;
164
+
165
+ overflow-y: auto;
166
+
167
+ box-sizing: border-box;
168
+
169
+ // Avoid height shake by clicking
170
+ height: auto !important;
171
+ max-height: calc(100vh - 2.7rem);
172
+ margin: 0;
173
+ padding: 0.6rem 0;
174
+ border: 1px solid var(--vp-c-divider);
175
+ border-radius: 0.5rem;
176
+
177
+ background-color: var(--vp-c-bg-elv);
178
+
179
+ text-align: start;
180
+ white-space: nowrap;
181
+ }
182
+ }
183
+
184
+ .vp-navbar-dropdown-title {
185
+ display: block;
186
+
187
+ padding: inherit;
188
+ border: none;
189
+
190
+ background: transparent;
191
+ color: var(--vp-c-text);
192
+
193
+ font-weight: 500;
194
+ font-size: 0.9rem;
195
+ font-family: inherit;
196
+ line-height: 1.4rem;
197
+
198
+ cursor: inherit;
199
+
200
+ .vp-navbar-dropdown-wrapper.mobile & {
201
+ display: none;
202
+ }
203
+
204
+ &:hover {
205
+ border-color: transparent;
206
+ }
207
+ }
208
+
209
+ .vp-navbar-dropdown-title-mobile {
210
+ display: none;
211
+
212
+ padding: inherit;
213
+ border: none;
214
+
215
+ background: transparent;
216
+ color: var(--vp-c-text);
217
+
218
+ font-weight: 600;
219
+ font-size: inherit;
220
+ font-family: inherit;
221
+ line-height: 1.4rem;
222
+
223
+ cursor: inherit;
224
+
225
+ .vp-navbar-dropdown-wrapper.mobile & {
226
+ display: block;
227
+ }
228
+
229
+ &:hover {
230
+ color: var(--vp-c-accent);
231
+ }
232
+ }
233
+
234
+ .vp-navbar-dropdown-item {
235
+ color: inherit;
236
+ line-height: 1.7rem;
237
+
238
+ .auto-link {
239
+ position: relative;
240
+
241
+ display: block;
242
+
243
+ margin-bottom: 0;
244
+ padding: 0 1.25rem;
245
+ border-bottom: none;
246
+
247
+ font-weight: 400;
248
+
249
+ &:hover {
250
+ color: var(--vp-c-accent);
251
+ }
252
+
253
+ &.route-link-active {
254
+ color: var(--vp-c-accent);
255
+
256
+ &::after {
257
+ content: '';
258
+
259
+ position: absolute;
260
+ inset-inline-start: 9px;
261
+ top: calc(50% - 2px);
262
+
263
+ width: 0;
264
+ height: 0;
265
+ border-top: 3px solid transparent;
266
+ border-bottom: 3px solid transparent;
267
+ border-inline-start: 5px solid var(--vp-c-accent);
268
+ }
269
+ }
270
+ }
271
+
272
+ .vp-navbar-items & .auto-link {
273
+ line-height: 1.7rem;
274
+ }
275
+
276
+ .vp-navbar-dropdown-wrapper.mobile & > .auto-link {
277
+ line-height: 2rem;
278
+ }
279
+ }
280
+
281
+ .vp-navbar-dropdown-subtitle {
282
+ margin: 0.45rem 0 0;
283
+ padding: 1rem 0 0.45rem;
284
+ border-top: 1px solid var(--vp-c-divider);
285
+ font-size: 0.9rem;
286
+
287
+ .vp-navbar-dropdown-wrapper.mobile & {
288
+ margin-top: 0;
289
+ padding-top: 0;
290
+ padding-bottom: 0;
291
+ border-top: 0;
292
+
293
+ line-height: 2rem;
294
+ }
295
+
296
+ .vp-navbar-dropdown-item:first-child & {
297
+ margin-top: 0;
298
+ padding-top: 0;
299
+ border-top: 0;
300
+ }
301
+
302
+ > span {
303
+ padding-inline: 1.25rem 1.5rem;
304
+ }
305
+
306
+ > .auto-link {
307
+ font-weight: inherit;
308
+
309
+ &.route-link-active {
310
+ &::after {
311
+ display: none;
312
+ }
313
+ }
314
+ }
315
+ }
316
+
317
+ .vp-navbar-dropdown-subitem-wrapper {
318
+ padding: 0;
319
+ list-style: none;
320
+ }
321
+
322
+ .vp-navbar-dropdown-subitem {
323
+ font-size: 0.9em;
324
+
325
+ .vp-navbar-dropdown-wrapper.mobile & {
326
+ padding-inline-start: 1rem;
327
+ }
328
+ }
329
+ </style>
@@ -0,0 +1,111 @@
1
+ <script setup lang="ts">
2
+ import VPAutoLink from '@theme/VPAutoLink.vue'
3
+ import VPNavbarDropdown from '@theme/VPNavbarDropdown.vue'
4
+ import { useData } from '@theme/useData'
5
+ import { useNavbarConfig } from '@theme/useNavbarConfig'
6
+ import { useNavbarRepo } from '@theme/useNavbarRepo'
7
+ import { useNavbarSelectLanguage } from '@theme/useNavbarSelectLanguage'
8
+ import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
9
+ import { computed, ref } from 'vue'
10
+
11
+ const { themeLocale } = useData()
12
+ const navbarConfig = useNavbarConfig()
13
+ const navbarSelectLanguage = useNavbarSelectLanguage()
14
+ const navbarRepo = useNavbarRepo()
15
+
16
+ const isMobile = ref(false)
17
+
18
+ const navbarLabel = computed(() => {
19
+ return themeLocale.value.navbarLabel ?? 'site navigation'
20
+ })
21
+
22
+ const navbarLinks = computed(() => [
23
+ ...navbarConfig.value,
24
+ ...navbarSelectLanguage.value,
25
+ ...navbarRepo.value,
26
+ ])
27
+
28
+ useUpdateDeviceStatus(
29
+ DeviceType.Mobile,
30
+ (mobileDesktopBreakpoint: number): void => {
31
+ // avoid overlapping of long title and long navbar links
32
+ isMobile.value = window.innerWidth < mobileDesktopBreakpoint
33
+ },
34
+ )
35
+ </script>
36
+
37
+ <template>
38
+ <nav
39
+ v-if="navbarLinks.length"
40
+ class="vp-navbar-items"
41
+ :aria-label="navbarLabel"
42
+ >
43
+ <div v-for="item in navbarLinks" :key="item.text" class="vp-navbar-item">
44
+ <VPNavbarDropdown
45
+ v-if="'children' in item"
46
+ :class="{ mobile: isMobile }"
47
+ :config="item"
48
+ />
49
+ <VPAutoLink v-else :config="item" />
50
+ </div>
51
+ </nav>
52
+ </template>
53
+
54
+ <style lang="scss">
55
+ @use '../styles/variables' as *;
56
+
57
+ .vp-navbar-items {
58
+ display: inline-block;
59
+
60
+ @media print {
61
+ display: none;
62
+ }
63
+
64
+ .auto-link {
65
+ color: inherit;
66
+ line-height: 1.4rem;
67
+
68
+ &:hover,
69
+ &.route-link-active {
70
+ color: var(--vp-c-text);
71
+ }
72
+ }
73
+ }
74
+
75
+ .vp-navbar-item {
76
+ position: relative;
77
+ display: inline-block;
78
+ margin-inline-start: 1.5rem;
79
+ line-height: var(--navbar-line-height);
80
+
81
+ @media (max-width: $MQMobile) {
82
+ margin-inline-start: 0;
83
+ }
84
+
85
+ &:first-child {
86
+ margin-inline-start: 0;
87
+ }
88
+
89
+ .auto-link {
90
+ &:hover,
91
+ &.route-link-active {
92
+ color: var(--vp-c-accent);
93
+ }
94
+ }
95
+
96
+ > .auto-link {
97
+ display: inline-block;
98
+
99
+ &:hover,
100
+ &.route-link-active {
101
+ margin-bottom: -2px;
102
+ border-bottom: 2px solid var(--vp-c-accent);
103
+
104
+ @media (max-width: $MQMobile) {
105
+ margin-bottom: 0;
106
+ border-bottom: none;
107
+ }
108
+ }
109
+ }
110
+ }
111
+ </style>
@@ -0,0 +1,69 @@
1
+ <script setup lang="ts">
2
+ import VPPageMeta from '@theme/VPPageMeta.vue'
3
+ import VPPageNav from '@theme/VPPageNav.vue'
4
+ import type { Slot } from '@vuepress/helper/client'
5
+ import { Content } from 'vuepress/client'
6
+
7
+ defineSlots<{
8
+ 'top'?: Slot
9
+ 'bottom'?: Slot
10
+ 'content-top'?: Slot
11
+ 'content-bottom'?: Slot
12
+ }>()
13
+ </script>
14
+
15
+ <template>
16
+ <main class="vp-page">
17
+ <slot name="top" />
18
+
19
+ <div vp-content>
20
+ <slot name="content-top" />
21
+
22
+ <Content id="content" />
23
+
24
+ <slot name="content-bottom" />
25
+ </div>
26
+
27
+ <VPPageMeta />
28
+
29
+ <VPPageNav />
30
+
31
+ <slot name="bottom" />
32
+ </main>
33
+ </template>
34
+
35
+ <style lang="scss">
36
+ @use '../styles/mixins';
37
+ @use '../styles/variables' as *;
38
+
39
+ .vp-page {
40
+ display: block;
41
+
42
+ // leave space for navbar
43
+ padding-top: var(--navbar-height);
44
+ padding-bottom: 2rem;
45
+
46
+ // leave space for sidebar
47
+ padding-inline-start: var(--sidebar-width);
48
+
49
+ // narrow desktop / iPad
50
+ @media (max-width: $MQNarrow) {
51
+ // leave space for sidebar
52
+ padding-inline-start: var(--sidebar-width-mobile);
53
+ }
54
+
55
+ // wide mobile
56
+ @media (max-width: $MQMobile) {
57
+ // sidebar is collapsed
58
+ padding-inline-start: 0;
59
+ }
60
+
61
+ [vp-content] {
62
+ @include mixins.content-wrapper;
63
+
64
+ & {
65
+ padding-top: 0;
66
+ }
67
+ }
68
+ }
69
+ </style>
@@ -0,0 +1,139 @@
1
+ <script setup lang="ts">
2
+ import VPAutoLink from '@theme/VPAutoLink.vue'
3
+ import VPEditIcon from '@theme/VPEditIcon.vue'
4
+ import { useData } from '@theme/useData'
5
+ import { useEditLink } from '@theme/useEditLink'
6
+ import { useContributors, useLastUpdated } from '@vuepress/plugin-git/client'
7
+
8
+ const { frontmatter, themeLocale } = useData()
9
+ const contributors = useContributors(
10
+ () =>
11
+ frontmatter.value.contributors ?? themeLocale.value.contributors ?? true,
12
+ )
13
+ const editLink = useEditLink()
14
+ const lastUpdated = useLastUpdated(
15
+ () => frontmatter.value.lastUpdated ?? themeLocale.value.lastUpdated ?? true,
16
+ )
17
+ </script>
18
+
19
+ <template>
20
+ <footer class="vp-page-meta">
21
+ <div v-if="editLink" class="vp-meta-item edit-link">
22
+ <VPAutoLink class="label" :config="editLink">
23
+ <template #before>
24
+ <VPEditIcon />
25
+ </template>
26
+ </VPAutoLink>
27
+ </div>
28
+
29
+ <div class="vp-meta-item git-info">
30
+ <div v-if="lastUpdated" class="vp-meta-item last-updated">
31
+ <span class="meta-item-label"
32
+ >{{ themeLocale.lastUpdatedText ?? lastUpdated.locale }}:
33
+ </span>
34
+ <time
35
+ class="meta-item-info"
36
+ :datetime="lastUpdated.iso"
37
+ data-allow-mismatch
38
+ >{{ lastUpdated.text }}</time
39
+ >
40
+ </div>
41
+
42
+ <div v-if="contributors.length" class="vp-meta-item contributors">
43
+ <span class="meta-item-label"
44
+ >{{ themeLocale.contributorsText }}:
45
+ </span>
46
+ <span class="meta-item-info">
47
+ <template v-for="(contributor, index) in contributors" :key="index">
48
+ <span class="contributor" :title="`email: ${contributor.email}`">
49
+ {{ contributor.name }}
50
+ </span>
51
+ <template v-if="index !== contributors.length - 1">, </template>
52
+ </template>
53
+ </span>
54
+ </div>
55
+ </div>
56
+ </footer>
57
+ </template>
58
+
59
+ <style lang="scss">
60
+ @use '../styles/mixins';
61
+ @use '../styles/variables' as *;
62
+
63
+ .vp-page-meta {
64
+ @include mixins.content-wrapper;
65
+
66
+ & {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ justify-content: space-between;
70
+
71
+ overflow: auto;
72
+
73
+ padding-top: 0.75rem;
74
+ padding-bottom: 0.75rem;
75
+ }
76
+
77
+ @media print {
78
+ margin: 0 !important;
79
+ padding-inline: 0 !important;
80
+ }
81
+
82
+ @media (max-width: $MQMobile) {
83
+ display: block;
84
+ }
85
+
86
+ .vp-meta-item {
87
+ flex-grow: 1;
88
+
89
+ .vp-meta-label {
90
+ font-weight: 500;
91
+
92
+ &:not(a) {
93
+ color: var(--vp-c-text-mute);
94
+ }
95
+ }
96
+
97
+ .vp-meta-info {
98
+ color: var(--vp-c-text-mute);
99
+ font-weight: 400;
100
+ }
101
+ }
102
+
103
+ .git-info {
104
+ text-align: end;
105
+ }
106
+
107
+ .edit-link {
108
+ margin-top: 0.25rem;
109
+ margin-bottom: 0.25rem;
110
+ margin-inline-end: 0.5rem;
111
+ font-size: 0.875em;
112
+
113
+ @media print {
114
+ display: none;
115
+ }
116
+
117
+ .edit-icon {
118
+ position: relative;
119
+ bottom: -0.125em;
120
+
121
+ width: 1em;
122
+ height: 1em;
123
+ margin-inline-end: 0.25em;
124
+ }
125
+ }
126
+
127
+ .last-updated,
128
+ .contributors {
129
+ margin-top: 0.25rem;
130
+ margin-bottom: 0.25rem;
131
+ font-size: 0.875em;
132
+
133
+ @media (max-width: $MQMobile) {
134
+ font-size: 0.825em;
135
+ text-align: start;
136
+ }
137
+ }
138
+ }
139
+ </style>