@vuepress/theme-default 2.0.0-rc.5 → 2.0.0-rc.54

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