Skip to content

Commit 09c1399

Browse files
committed
refactor(blog): use last edit date for blog post timestamps
1 parent 8f04f49 commit 09c1399

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/(home)/blog/[slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { lastEdit } from "@/lib/api"
12
import { blog } from "@/lib/source"
23
import { getMDXComponents } from "@/mdx-components"
34
import { PathUtils } from "fumadocs-core/source"
@@ -27,7 +28,7 @@ export default async function Page(props: PageProps<"/blog/[slug]">) {
2728
<p className="text-xs uppercase tracking-wide text-neutral-500">Published</p>
2829
<p className="font-medium">
2930
{new Date(
30-
page.data.date ?? PathUtils.basename(page.path, PathUtils.extname(page.path)),
31+
await lastEdit(page) ?? PathUtils.basename(page.path, PathUtils.extname(page.path)),
3132
).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })}
3233
</p>
3334
</div>

0 commit comments

Comments
 (0)