Skip to content

Commit ba8e0dc

Browse files
committed
fix: table
1 parent b76d39b commit ba8e0dc

File tree

4 files changed

+411
-145
lines changed

4 files changed

+411
-145
lines changed

apps/www/components/mdx-components.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,32 @@ export const MDXComponents = {
8787
</pre>
8888
);
8989
},
90+
table: ({ children }: { children: React.ReactNode }) => (
91+
<div className="my-8 overflow-x-auto">
92+
<table className="w-full border-collapse border border-border">
93+
{children}
94+
</table>
95+
</div>
96+
),
97+
thead: ({ children }: { children: React.ReactNode }) => (
98+
<thead className="bg-muted/50">{children}</thead>
99+
),
100+
tbody: ({ children }: { children: React.ReactNode }) => (
101+
<tbody>{children}</tbody>
102+
),
103+
tr: ({ children }: { children: React.ReactNode }) => (
104+
<tr className="border-b border-border hover:bg-muted/30 transition-colors">
105+
{children}
106+
</tr>
107+
),
108+
th: ({ children }: { children: React.ReactNode }) => (
109+
<th className="border border-border px-4 py-3 text-left font-semibold text-foreground">
110+
{children}
111+
</th>
112+
),
113+
td: ({ children }: { children: React.ReactNode }) => (
114+
<td className="border border-border px-4 py-3 text-foreground/90">
115+
{children}
116+
</td>
117+
),
90118
};

apps/www/contentlayer.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineDocumentType, makeSource } from "contentlayer/source-files";
22
import { format, parseISO } from "date-fns";
33
import rehypePrismPlus from "rehype-prism-plus";
44
import rehypeSlug from "rehype-slug";
5+
import remarkGfm from "remark-gfm";
56

67
export const Post = defineDocumentType(() => ({
78
name: "Post",
@@ -61,7 +62,7 @@ export default makeSource({
6162
contentDirPath: "posts",
6263
documentTypes: [Post],
6364
mdx: {
64-
remarkPlugins: [],
65+
remarkPlugins: [remarkGfm],
6566
rehypePlugins: [
6667
rehypeSlug,
6768
[

apps/www/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@
1919
"contentlayer": "^0.3.4",
2020
"date-fns": "^4.1.0",
2121
"lucide-react": "^0.525.0",
22-
"next": "^15.4.1",
22+
"next": "^15.4.6",
2323
"next-contentlayer": "^0.3.4",
2424
"next-themes": "^0.4.6",
25-
"react": "^19.1.0",
26-
"react-dom": "^19.1.0",
25+
"react": "^19.1.1",
26+
"react-dom": "^19.1.1",
2727
"react-syntax-highlighter": "^15.6.1",
2828
"rehype-highlight": "^7.0.2",
2929
"rehype-prism-plus": "^2.0.1",
3030
"rehype-slug": "^6.0.0",
31-
"sonner": "^2.0.6"
31+
"remark-gfm": "3.0.1",
32+
"sonner": "^2.0.7"
3233
},
3334
"devDependencies": {
34-
"@types/node": "^24.0.14",
35-
"@types/react": "^19.1.8",
36-
"@types/react-dom": "^19.1.6",
35+
"@types/node": "^24.2.0",
36+
"@types/react": "^19.1.9",
37+
"@types/react-dom": "^19.1.7",
3738
"@types/react-syntax-highlighter": "^15.5.13",
3839
"@workspace/eslint-config": "workspace:^",
3940
"@workspace/typescript-config": "workspace:*",
40-
"typescript": "^5.8.3"
41+
"typescript": "^5.9.2"
4142
}
4243
}

0 commit comments

Comments
 (0)