Skip to content

Commit d0e8b53

Browse files
committed
feat: add last modified date display and clean up imports in documentation pages
- Integrated the lastModified plugin to show the last updated date on documentation pages. - Cleaned up duplicate imports in the page component for improved code clarity.
1 parent 9abdd71 commit d0e8b53

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

apps/fumadocs/source.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
frontmatterSchema,
55
metaSchema,
66
} from "fumadocs-mdx/config";
7+
import lastModified from "fumadocs-mdx/plugins/last-modified";
78

89
// You can customise Zod schemas for frontmatter and `meta.json` here
910
// see https://fumadocs.dev/docs/mdx/collections
@@ -21,6 +22,7 @@ export const docs = defineDocs({
2122
});
2223

2324
export default defineConfig({
25+
plugins: [lastModified()],
2426
mdxOptions: {
2527
// MDX options
2628
},

apps/fumadocs/src/app/docs/[[...slug]]/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export default async function Page(props: PageProps) {
3636
})}
3737
/>
3838

39+
{page.data.lastModified && (
40+
<p className="text-muted-foreground text-sm">
41+
Updated: {page.data.lastModified.toLocaleDateString()}
42+
</p>
43+
)}
44+
3945
<div className="flex flex-row items-center gap-2 border-b pt-2 pb-6">
4046
<LLMCopyButton markdownUrl={`${page.url}.mdx`} />
4147
<ViewOptions

0 commit comments

Comments
 (0)