Skip to content

Commit 98472a4

Browse files
author
Lasim
committed
feat: update .gitignore and improve MDX component integration for enhanced documentation structure
1 parent 4393c4b commit 98472a4

7 files changed

Lines changed: 28 additions & 32 deletions

File tree

.gitignore

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ node_modules/
2323
.idea/
2424
.DS_Store
2525

26-
# Next.js build outputs
27-
.next/
28-
out/
29-
dist/
30-
build/
26+
# outputs
27+
.turbo
28+
.next
29+
dist
30+
.contentlayer
31+
.eslintcache
32+
.source
3133

3234
# Next.js cache
3335
.next/cache/
3436

35-
# Vercel deployment outputs
36-
.vercel/
37-
3837
# Fumadocs generated files
3938
.fumadocs/
4039

app/docs/[[...slug]]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { generatePageMetadata, getCanonicalUrl } from '@/lib/seo-utils';
66
import { CustomNavbar } from '@/lib/components/CustomNavbar';
77
import { getFinalPageTitle } from '@/lib/h1-extractor';
88
import { readFile } from 'fs/promises';
9+
import { getMDXComponents } from '@/mdx-components';
910

1011
export default async function Page({
1112
params,
@@ -25,7 +26,7 @@ export default async function Page({
2526
<DocsPage toc={page.data.toc} full={page.data.full}>
2627
<CustomNavbar />
2728
<DocsBody>
28-
<MDX />
29+
<MDX components={getMDXComponents()} />
2930
</DocsBody>
3031
</DocsPage>
3132
);

app/global.css

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
/* Import Tailwind CSS */
2-
@import 'tailwindcss';
3-
4-
/* Import Fumadocs UI base styles */
5-
/* From the docs:
6-
@import 'tailwindcss'; // Already handled by individual imports above for clarity
7-
@import 'fumadocs-ui/css/neutral.css';
8-
@import 'fumadocs-ui/css/preset.css';
9-
*/
10-
@import 'fumadocs-ui/css/neutral.css'; /* Recommended for a neutral color palette */
11-
@import 'fumadocs-ui/css/preset.css'; /* Core Fumadocs UI styles */
1+
/* Import Fumadocs UI complete styles */
2+
@import 'fumadocs-ui/css/style.css';
123

134
/* Custom navbar styling to match main site */
145
/* Navbar height override removed since navbar is now inside content area */

docs/deploystack/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ DeployStack helps you deploy Docker Compose and Docker Run applications across d
2020
- [Docker-to-IaC Module Documentation](/docs/docker-to-iac/index.md)
2121
- [Join our Discord](https://discord.gg/UjFWwByB)
2222
- [Visit DeployStack](https://deploystack.io)
23+

mdx-components.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import defaultMdxComponents from 'fumadocs-ui/mdx';
2-
import type { ComponentType } from 'react';
3-
4-
type MDXComponents = {
5-
[key: string]: ComponentType<any>;
6-
};
1+
import defaultComponents from 'fumadocs-ui/mdx';
2+
import type { MDXComponents } from 'mdx/types';
73

84
// You can add your own global components here
95
const customComponents: MDXComponents = {
@@ -13,7 +9,7 @@ const customComponents: MDXComponents = {
139

1410
export function getMDXComponents(components?: MDXComponents): MDXComponents {
1511
return {
16-
...defaultMdxComponents,
12+
...defaultComponents,
1713
...customComponents,
1814
...components,
1915
};

next.config.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { createMDX } from 'fumadocs-mdx/next';
22

3-
const withMDX = createMDX({
4-
// Options for fumadocs-mdx
5-
// source: './source.config.ts' // Default, if you have custom options for content
6-
});
3+
const withMDX = createMDX();
74

85
/** @type {import('next').NextConfig} */
96
const config = {

source.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineDocs, frontmatterSchema } from 'fumadocs-mdx/config';
1+
import { defineDocs, defineConfig, frontmatterSchema } from 'fumadocs-mdx/config';
22
import { z } from 'zod';
33

44
export const docs = defineDocs({
@@ -11,3 +11,14 @@ export const docs = defineDocs({
1111
}),
1212
},
1313
});
14+
15+
export default defineConfig({
16+
mdxOptions: {
17+
rehypeCodeOptions: {
18+
themes: {
19+
light: 'github-light',
20+
dark: 'github-dark',
21+
},
22+
},
23+
},
24+
});

0 commit comments

Comments
 (0)