From 7fcf462eb8c2be6e72b4426a8211fcd6961e4967 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 9 Jun 2024 10:24:40 +0530 Subject: [PATCH] fix(build): respect frontmatter.lastUpdated for pageData.lastUpdated and sitemap generation closes #3931 --- .../theme-default/components/VPDocFooter.vue | 42 +++++++++++++------ .../components/VPDocFooterLastUpdated.vue | 4 +- src/node/build/generateSitemap.ts | 7 ++++ src/node/markdownToVue.ts | 8 +++- 4 files changed, 44 insertions(+), 17 deletions(-) diff --git a/src/client/theme-default/components/VPDocFooter.vue b/src/client/theme-default/components/VPDocFooter.vue index 61d2398b..0b6ff2a8 100644 --- a/src/client/theme-default/components/VPDocFooter.vue +++ b/src/client/theme-default/components/VPDocFooter.vue @@ -11,15 +11,17 @@ const { theme, page, frontmatter } = useData() const editLink = useEditLink() const control = usePrevNext() -const hasEditLink = computed(() => { - return theme.value.editLink && frontmatter.value.editLink !== false -}) -const hasLastUpdated = computed(() => { - return page.value.lastUpdated && frontmatter.value.lastUpdated !== false -}) -const showFooter = computed(() => { - return hasEditLink.value || hasLastUpdated.value || control.value.prev || control.value.next -}) +const hasEditLink = computed( + () => theme.value.editLink && frontmatter.value.editLink !== false +) +const hasLastUpdated = computed(() => page.value.lastUpdated) +const showFooter = computed( + () => + hasEditLink.value || + hasLastUpdated.value || + control.value.prev || + control.value.next +)