diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts
index 0490caa4..9bd19935 100644
--- a/docs/.vitepress/config.ts
+++ b/docs/.vitepress/config.ts
@@ -4,6 +4,7 @@ export default defineConfig({
lang: 'en-US',
title: 'VitePress',
description: 'Vite & Vue powered static site generator.',
+
lastUpdated: true,
themeConfig: {
diff --git a/docs/config/app-configs.md b/docs/config/app-configs.md
index 631cc347..3e3d4b0c 100644
--- a/docs/config/app-configs.md
+++ b/docs/config/app-configs.md
@@ -152,7 +152,7 @@ export default {
- Type: `boolean`
- Default: `false`
-Use git commit to get the timestamp. Some themes may use it.
+Use git commit to get the timestamp. This option enables the default theme to display the page's last updated time. You can customize the text via [`themeConfig.lastUpdatedText`](theme-configs#lastupdatedtext) option.
```ts
export default {
diff --git a/docs/config/theme-configs.md b/docs/config/theme-configs.md
index b576a577..d98ea791 100644
--- a/docs/config/theme-configs.md
+++ b/docs/config/theme-configs.md
@@ -33,21 +33,6 @@ export default {
}
```
-## lastUpdated
-
-- Type: `string`
-- Default: `Last Updated`
-
-The Last Updated prompt text.
-
-```ts
-export default {
- themeConfig: {
- lastUpdated: 'Updated Date'
- }
-}
-```
-
## footer
- Type: `Footer`
@@ -72,6 +57,21 @@ export interface Footer {
}
```
+## lastUpdatedText
+
+- Type: `string`
+- Default: `Last updated`
+
+The prefix text showing right before the last updated time.
+
+```ts
+export default {
+ themeConfig: {
+ lastUpdatedText: 'Updated Date'
+ }
+}
+```
+
## carbonAds
- Type: `CarbonAds`
diff --git a/src/client/theme-default/components/VPDocFooter.vue b/src/client/theme-default/components/VPDocFooter.vue
index 8925cae6..f63e8b6f 100644
--- a/src/client/theme-default/components/VPDocFooter.vue
+++ b/src/client/theme-default/components/VPDocFooter.vue
@@ -5,7 +5,7 @@ import { useEditLink } from '../composables/edit-link'
import { usePrevNext } from '../composables/prev-next'
import VPIconEdit from './icons/VPIconEdit.vue'
import VPLink from './VPLink.vue'
-import VPLastUpdated from './VPLastUpdated.vue'
+import VPDocFooterLastUpdated from './VPDocFooterLastUpdated.vue'
const { theme, page, frontmatter } = useData()
@@ -22,7 +22,10 @@ const control = usePrevNext()
{{ editLink.text }}
-
+ {{ theme.lastUpdatedText ?? 'Last updated' }}: + +
+ + + diff --git a/src/client/theme-default/components/VPLastUpdated.vue b/src/client/theme-default/components/VPLastUpdated.vue deleted file mode 100644 index 4e8eacca..00000000 --- a/src/client/theme-default/components/VPLastUpdated.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - -