From 8105e2577d4aa401f960e78085f6038eb879ee8a Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 24 Dec 2021 15:06:12 +0100 Subject: chore: replace legal notice page content with MDX content I cannot use WordPress shortcodes from a custom plugin through WP GraphQL so I'm using mdx file instead to define the page content. --- src/content | 2 +- src/pages/mentions-legales.tsx | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/content b/src/content index 9f37f10..cc48676 160000 --- a/src/content +++ b/src/content @@ -1 +1 @@ -Subproject commit 9f37f1095e625ef2d42dd3c64144b77424ac4ead +Subproject commit cc486766242f106dbefabb70c6a78b2470490d00 diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index 41e9a0c..6bb1a55 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.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 LegalNoticeContent, { meta } from '@content/pages/legal-notice.mdx'; -const LegalNotice: NextPageWithLayout = ({ page }) => { +const LegalNotice: NextPageWithLayout = () => { return ( <> @@ -17,17 +16,10 @@ const LegalNotice: NextPageWithLayout = ({ page }) => {
-

{page.title}

- {page.content && ( -
- )} +

{meta.title}

-
+
); @@ -42,13 +34,11 @@ export const getStaticProps: GetStaticProps = async ( context.locale!, process.env.NODE_ENV === 'production' ); - const page = await getPageByUri('/mentions-legales/'); - const breadcrumbTitle = page.title; + const breadcrumbTitle = meta.title; return { props: { breadcrumbTitle, - page, translation, }, }; -- cgit v1.2.3