aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/cv.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-24 15:35:33 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-24 15:37:26 +0100
commit0bb6411ee9fce02c2e5680f2be5740a1bbb508ad (patch)
tree59b574dbda693dc5f1b2605272a6eff3b23802f2 /src/pages/cv.tsx
parent3956ed77e11455a963ce17a64783d70fa666a7a0 (diff)
chore: replace CV content with mdx content
Since I replace the other pages, there is no reason to fetch this page content through WP GraphQL.
Diffstat (limited to 'src/pages/cv.tsx')
-rw-r--r--src/pages/cv.tsx21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx
index 44d943c..5107f6a 100644
--- a/src/pages/cv.tsx
+++ b/src/pages/cv.tsx
@@ -1,14 +1,13 @@
import { getLayout } from '@components/Layouts/Layout';
import ToC from '@components/ToC/ToC';
import { seo } from '@config/seo';
-import { getPageByUri } from '@services/graphql/queries';
import { NextPageWithLayout } from '@ts/types/app';
-import { PageProps } from '@ts/types/pages';
import { loadTranslation } from '@utils/helpers/i18n';
import { GetStaticProps, GetStaticPropsContext } from 'next';
import Head from 'next/head';
+import CVContent, { intro, meta } from '@content/pages/cv.mdx';
-const CV: NextPageWithLayout<PageProps> = ({ page }) => {
+const CV: NextPageWithLayout = () => {
return (
<>
<Head>
@@ -17,17 +16,11 @@ const CV: NextPageWithLayout<PageProps> = ({ page }) => {
</Head>
<article>
<header>
- <h1>{page.title}</h1>
- {page.content && (
- <div dangerouslySetInnerHTML={{ __html: page.intro }}></div>
- )}
+ <h1>{meta.title}</h1>
+ <div dangerouslySetInnerHTML={{ __html: intro }}></div>
</header>
<ToC />
- <div
- dangerouslySetInnerHTML={{
- __html: page.content ? page.content : page.intro,
- }}
- ></div>
+ <CVContent />
</article>
</>
);
@@ -42,13 +35,11 @@ export const getStaticProps: GetStaticProps = async (
context.locale!,
process.env.NODE_ENV === 'production'
);
- const page = await getPageByUri('/cv/');
- const breadcrumbTitle = page.title;
+ const breadcrumbTitle = meta.title;
return {
props: {
breadcrumbTitle,
- page,
translation,
},
};