aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/projets/index.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-22 17:45:03 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-22 17:46:32 +0100
commit0ac690339083f01a0b12a74ec117eeccd055e932 (patch)
tree539ffee3b35b086a8c035e5abc916ab603fe0001 /src/pages/projets/index.tsx
parentd4045fbcbfa8208ec31539744417f315f1f6fad8 (diff)
refactor(components,pages): extract MDX components mapping from pages
Instead of repeating the overriding on each pages, we should define it in one place and reuse it in pages. By default it is not possible to override native HTML tags with MDX so I added a plugin in next config to allow it.
Diffstat (limited to 'src/pages/projets/index.tsx')
-rw-r--r--src/pages/projets/index.tsx9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/pages/projets/index.tsx b/src/pages/projets/index.tsx
index 0b9a91c..fc6eb5f 100644
--- a/src/pages/projets/index.tsx
+++ b/src/pages/projets/index.tsx
@@ -1,5 +1,4 @@
/* eslint-disable max-statements */
-import type { MDXComponents } from 'mdx/types';
import type { GetStaticProps } from 'next';
import Head from 'next/head';
import NextImage from 'next/image';
@@ -16,13 +15,13 @@ import {
getLayout,
Grid,
type GridItem,
- Link,
MetaList,
MetaItem,
Page,
PageHeader,
PageBody,
} from '../../components';
+import { mdxComponents } from '../../components/mdx';
import PageContent, { meta } from '../../content/pages/projects.mdx';
import styles from '../../styles/pages/projects.module.scss';
import type { NextPageWithLayout, ProjectCard } from '../../types';
@@ -40,10 +39,6 @@ import {
} from '../../utils/helpers/server';
import { useBreadcrumb } from '../../utils/hooks';
-const components: MDXComponents = {
- Link,
-};
-
type ProjectsPageProps = {
projects: ProjectCard[];
translation?: Messages;
@@ -167,7 +162,7 @@ const ProjectsPage: NextPageWithLayout<ProjectsPageProps> = ({ projects }) => {
/>
<PageHeader
heading={title}
- intro={<PageContent components={components} />}
+ intro={<PageContent components={mdxComponents} />}
/>
<PageBody className={styles.body}>
<Grid