Skip to content

Commit 711019d

Browse files
committed
chore: vars cleanup
1 parent abc2ec7 commit 711019d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export const getStaticProps = (async (context) => {
156156
const timeToRead = readingTime(markdown.content)
157157
const tocItems = remapTableOfContents(tocNodeItems, mdxSource.compiledSource)
158158
const slug = `/${params.slug.join("/")}/`
159-
const lastDeployDate = getLastDeployDate()
160159

161160
// Get corresponding layout
162161
let layout = (frontmatter.template as Layout) ?? "static"
@@ -186,6 +185,16 @@ export const getStaticProps = (async (context) => {
186185
commitHistoryCache
187186
)
188187

188+
const lastDeployDate = getLastDeployDate()
189+
const lastEditLocaleTimestamp = getLocaleTimestamp(
190+
locale as Lang,
191+
lastUpdatedDate
192+
)
193+
const lastDeployLocaleTimestamp = getLocaleTimestamp(
194+
locale as Lang,
195+
lastDeployDate
196+
)
197+
189198
const gfissues = await gfIssuesDataFetch()
190199

191200
return {
@@ -194,14 +203,8 @@ export const getStaticProps = (async (context) => {
194203
mdxSource,
195204
slug,
196205
frontmatter,
197-
lastEditLocaleTimestamp: getLocaleTimestamp(
198-
locale as Lang,
199-
lastUpdatedDate
200-
),
201-
lastDeployLocaleTimestamp: getLocaleTimestamp(
202-
locale as Lang,
203-
lastDeployDate
204-
),
206+
lastEditLocaleTimestamp,
207+
lastDeployLocaleTimestamp,
205208
contentNotTranslated,
206209
layout,
207210
timeToRead: Math.round(timeToRead.minutes),

0 commit comments

Comments
 (0)