@vuepress/theme-default 2.0.0-rc.7 → 2.0.0-rc.71

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