Skip to content

Commit abc2ec7

Browse files
committed
fix: add missing lastDeployLocaleTimestamp for md pages
1 parent 9331d62 commit abc2ec7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pages/[...slug].tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import PageMetadata from "@/components/PageMetadata"
2929

3030
import { getFileContributorInfo } from "@/lib/utils/contributors"
3131
import { dateToString } from "@/lib/utils/date"
32+
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
3233
import { getContent, getContentBySlug } from "@/lib/utils/md"
3334
import { runOnlyOnce } from "@/lib/utils/runOnlyOnce"
3435
import { getLocaleTimestamp } from "@/lib/utils/time"
@@ -155,6 +156,7 @@ export const getStaticProps = (async (context) => {
155156
const timeToRead = readingTime(markdown.content)
156157
const tocItems = remapTableOfContents(tocNodeItems, mdxSource.compiledSource)
157158
const slug = `/${params.slug.join("/")}/`
159+
const lastDeployDate = getLastDeployDate()
158160

159161
// Get corresponding layout
160162
let layout = (frontmatter.template as Layout) ?? "static"
@@ -196,6 +198,10 @@ export const getStaticProps = (async (context) => {
196198
locale as Lang,
197199
lastUpdatedDate
198200
),
201+
lastDeployLocaleTimestamp: getLocaleTimestamp(
202+
locale as Lang,
203+
lastDeployDate
204+
),
199205
contentNotTranslated,
200206
layout,
201207
timeToRead: Math.round(timeToRead.minutes),
@@ -232,6 +238,7 @@ ContentPage.getLayout = (page) => {
232238
slug,
233239
frontmatter,
234240
lastEditLocaleTimestamp,
241+
lastDeployLocaleTimestamp,
235242
layout,
236243
timeToRead,
237244
tocItems,
@@ -243,6 +250,7 @@ ContentPage.getLayout = (page) => {
243250
slug,
244251
frontmatter,
245252
lastEditLocaleTimestamp,
253+
lastDeployLocaleTimestamp,
246254
timeToRead,
247255
tocItems,
248256
contributors,

0 commit comments

Comments
 (0)