@vuepress/theme-default 2.0.0-rc.85 → 2.0.0-rc.87

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.
@@ -1,15 +1,19 @@
1
1
  <script setup lang="ts">
2
2
  import VPAutoLink from '@theme/VPAutoLink.vue'
3
3
  import VPEditIcon from '@theme/VPEditIcon.vue'
4
- import { useContributors } from '@theme/useContributors'
5
4
  import { useData } from '@theme/useData'
6
5
  import { useEditLink } from '@theme/useEditLink'
7
- import { useLastUpdated } from '@theme/useLastUpdated'
6
+ import { useContributors, useLastUpdated } from '@vuepress/plugin-git/client'
8
7
 
9
- const { themeLocale } = useData()
8
+ const { frontmatter, themeLocale } = useData()
9
+ const contributors = useContributors(
10
+ () =>
11
+ frontmatter.value.contributors ?? themeLocale.value.contributors ?? true,
12
+ )
10
13
  const editLink = useEditLink()
11
- const lastUpdated = useLastUpdated()
12
- const contributors = useContributors()
14
+ const lastUpdated = useLastUpdated(
15
+ () => frontmatter.value.lastUpdated ?? themeLocale.value.lastUpdated ?? true,
16
+ )
13
17
  </script>
14
18
 
15
19
  <template>
@@ -24,16 +28,18 @@ const contributors = useContributors()
24
28
 
25
29
  <div class="vp-meta-item git-info">
26
30
  <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
+ <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
+ >
31
40
  </div>
32
41
 
33
- <div
34
- v-if="contributors && contributors.length"
35
- class="vp-meta-item contributors"
36
- >
42
+ <div v-if="contributors.length" class="vp-meta-item contributors">
37
43
  <span class="meta-item-label"
38
44
  >{{ themeLocale.contributorsText }}:
39
45
  </span>
@@ -1,8 +1,6 @@
1
- export * from './useContributors.js';
2
1
  export * from './useDarkMode.js';
3
2
  export * from './useData.js';
4
3
  export * from './useEditLink.js';
5
- export * from './useLastUpdated.js';
6
4
  export * from './useNavigate.js';
7
5
  export * from './useNavbarConfig.js';
8
6
  export * from './useNavbarRepo.js';
@@ -1,8 +1,6 @@
1
- export * from './useContributors.js';
2
1
  export * from './useDarkMode.js';
3
2
  export * from './useData.js';
4
3
  export * from './useEditLink.js';
5
- export * from './useLastUpdated.js';
6
4
  export * from './useNavigate.js';
7
5
  export * from './useNavbarConfig.js';
8
6
  export * from './useNavbarRepo.js';
@@ -15,7 +15,6 @@ export const DEFAULT_LOCALE_OPTIONS = {
15
15
  editLink: true,
16
16
  editLinkText: 'Edit this page',
17
17
  lastUpdated: true,
18
- lastUpdatedText: 'Last Updated',
19
18
  contributors: true,
20
19
  contributorsText: 'Contributors',
21
20
  // 404 page messages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.85",
3
+ "version": "2.0.0-rc.87",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -37,27 +37,27 @@
37
37
  "templates"
38
38
  ],
39
39
  "dependencies": {
40
- "@vuepress/helper": "2.0.0-rc.85",
41
- "@vuepress/plugin-active-header-links": "2.0.0-rc.85",
42
- "@vuepress/plugin-back-to-top": "2.0.0-rc.85",
43
- "@vuepress/plugin-copy-code": "2.0.0-rc.85",
44
- "@vuepress/plugin-git": "2.0.0-rc.85",
45
- "@vuepress/plugin-links-check": "2.0.0-rc.85",
46
- "@vuepress/plugin-markdown-hint": "2.0.0-rc.85",
47
- "@vuepress/plugin-markdown-tab": "2.0.0-rc.85",
48
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.85",
49
- "@vuepress/plugin-nprogress": "2.0.0-rc.85",
50
- "@vuepress/plugin-palette": "2.0.0-rc.85",
51
- "@vuepress/plugin-prismjs": "2.0.0-rc.85",
52
- "@vuepress/plugin-seo": "2.0.0-rc.85",
53
- "@vuepress/plugin-sitemap": "2.0.0-rc.85",
54
- "@vuepress/plugin-theme-data": "2.0.0-rc.79",
40
+ "@vuepress/helper": "2.0.0-rc.86",
41
+ "@vuepress/plugin-active-header-links": "2.0.0-rc.86",
42
+ "@vuepress/plugin-back-to-top": "2.0.0-rc.86",
43
+ "@vuepress/plugin-copy-code": "2.0.0-rc.86",
44
+ "@vuepress/plugin-git": "2.0.0-rc.87",
45
+ "@vuepress/plugin-links-check": "2.0.0-rc.86",
46
+ "@vuepress/plugin-markdown-hint": "2.0.0-rc.86",
47
+ "@vuepress/plugin-markdown-tab": "2.0.0-rc.86",
48
+ "@vuepress/plugin-medium-zoom": "2.0.0-rc.86",
49
+ "@vuepress/plugin-nprogress": "2.0.0-rc.86",
50
+ "@vuepress/plugin-palette": "2.0.0-rc.86",
51
+ "@vuepress/plugin-prismjs": "2.0.0-rc.86",
52
+ "@vuepress/plugin-seo": "2.0.0-rc.87",
53
+ "@vuepress/plugin-sitemap": "2.0.0-rc.87",
54
+ "@vuepress/plugin-theme-data": "2.0.0-rc.86",
55
55
  "@vueuse/core": "^13.0.0",
56
56
  "vue": "^3.5.13"
57
57
  },
58
58
  "peerDependencies": {
59
- "sass": "^1.85.0",
60
- "sass-embedded": "^1.85.0",
59
+ "sass": "^1.86.0",
60
+ "sass-embedded": "^1.86.0",
61
61
  "sass-loader": "^16.0.5",
62
62
  "vuepress": "2.0.0-rc.20"
63
63
  },
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "fc47c22ba545338967d606a3bfd12f58bbb9af10"
78
+ "gitHead": "385bacf797c476232d32284e1940285b62a0e255"
79
79
  }
@@ -1,3 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { DefaultThemePageData } from '../../shared/index.js';
3
- export declare const useContributors: () => ComputedRef<Exclude<DefaultThemePageData["git"], undefined>["contributors"] | null>;
@@ -1,11 +0,0 @@
1
- import { useData } from '@theme/useData';
2
- import { computed } from 'vue';
3
- export const useContributors = () => {
4
- const { themeLocale, page, frontmatter } = useData();
5
- return computed(() => {
6
- const showContributors = frontmatter.value.contributors ?? themeLocale.value.contributors ?? true;
7
- if (!showContributors)
8
- return null;
9
- return page.value.git?.contributors ?? null;
10
- });
11
- };
@@ -1,2 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- export declare const useLastUpdated: () => ComputedRef<string | null>;
@@ -1,14 +0,0 @@
1
- import { useData } from '@theme/useData';
2
- import { computed } from 'vue';
3
- export const useLastUpdated = () => {
4
- const { frontmatter, page, themeLocale } = useData();
5
- return computed(() => {
6
- const showLastUpdated = frontmatter.value.lastUpdated ?? themeLocale.value.lastUpdated ?? true;
7
- if (!showLastUpdated)
8
- return null;
9
- if (!page.value.git?.updatedTime)
10
- return null;
11
- const updatedDate = new Date(page.value.git.updatedTime);
12
- return updatedDate.toLocaleString();
13
- });
14
- };