Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import createMDX from "@next/mdx";
import rehypeSlug from "rehype-slug";
import remarkEmoji from "remark-emoji";
import remarkPrism from "remark-prism";
import rehypeToc from "@jsdevtools/rehype-toc";
import remarkFrontmatter from "remark-frontmatter";
import rehypeAutolinkHeadings from "rehype-autolink-headings";

/** @type {import("next").NextConfig} */
const nextConfig = {
Expand All @@ -23,20 +17,8 @@ const nextConfig = {

const withMDX = createMDX({
options: {
remarkPlugins: [remarkFrontmatter, remarkEmoji, remarkPrism],
rehypePlugins: [
rehypeSlug,
rehypeAutolinkHeadings,
[
rehypeToc,
{
customizeTOC: tableOfContents => {
// quick and dirty solution to not display the ToC in the about page
return tableOfContents.children?.[0]?.children?.[0]?.data?.hookArgs?.[0]?.properties?.id !== "about-me";
},
},
],
],
remarkPlugins: ["remark-frontmatter", "remark-emoji", "remark-prism"],
rehypePlugins: ["rehype-slug", "rehype-autolink-headings", ["@jsdevtools/rehype-toc"]],
},
});

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"@vercel/analytics": "1.6.1",
"chalk": "5.6.2",
"clsx": "2.1.1",
"next": "15.5.9",
"next": "16.0.10",
"react": "19.2.3",
"react-dom": "19.2.3"
},
"devDependencies": {
"@jsdevtools/rehype-toc": "3.0.2",
"@mdx-js/loader": "3.1.1",
"@mdx-js/react": "3.1.1",
"@next/mdx": "15.5.9",
"@next/mdx": "16.0.10",
"@octokit/rest": "22.0.1",
"@tailwindcss/postcss": "4.1.18",
"@types/jest": "30.0.0",
Expand All @@ -41,7 +41,7 @@
"cross-env": "10.1.0",
"debug": "4.4.3",
"eslint": "9.39.2",
"eslint-config-next": "15.5.9",
"eslint-config-next": "16.0.10",
"eslint-config-prettier": "10.1.8",
"gray-matter": "4.0.3",
"jest": "30.2.0",
Expand Down
1 change: 1 addition & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const CustomApp = ({ Component, pageProps, router }: AppProps) => {
className={clsx(
"grow overflow-auto px-2 pt-2 md:px-0",
category === "about" || (category === "blog" && !inPostsList) ? "blog-post-container" : "",
category === "about" ? "hide-toc" : "",
)}
>
<Component {...pageProps} />
Expand Down
6 changes: 6 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,10 @@
#root {
@apply font-sans text-white antialiased;
}

.hide-toc {
.toc {
@apply hidden;
}
}
}
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
Expand All @@ -35,7 +35,8 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down
Loading