diff --git a/docs/reference/frontmatter-config.md b/docs/reference/frontmatter-config.md index 10297687ec30..28da1383ce08 100644 --- a/docs/reference/frontmatter-config.md +++ b/docs/reference/frontmatter-config.md @@ -163,10 +163,10 @@ The levels of header in the outline to display for the page. It's same as [confi ### lastUpdated -- Type: `boolean` +- Type: `boolean | Date` - Default: `true` -Whether to display [last updated](./default-theme-last-updated) text in the footer of the current page. +Whether to display [last updated](./default-theme-last-updated) text in the footer of the current page. If a datetime is specified, it will be displayed instead of the last git modified timestamp. ```yaml --- diff --git a/src/client/theme-default/components/VPDocFooterLastUpdated.vue b/src/client/theme-default/components/VPDocFooterLastUpdated.vue index bb551cd430d3..8ee8f32080f1 100644 --- a/src/client/theme-default/components/VPDocFooterLastUpdated.vue +++ b/src/client/theme-default/components/VPDocFooterLastUpdated.vue @@ -2,9 +2,11 @@ import { ref, computed, watchEffect, onMounted } from 'vue' import { useData } from '../composables/data' -const { theme, page } = useData() +const { theme, page, frontmatter } = useData() -const date = computed(() => new Date(page.value.lastUpdated!)) +const date = computed( + () => new Date(frontmatter.value.lastUpdated ?? page.value.lastUpdated) +) const isoDatetime = computed(() => date.value.toISOString()) const datetime = ref('')