From 926e1df1e9a7de29134293fe2306c9d9ecb594a6 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 21 Dec 2021 15:20:17 +0100
Subject: chore: add a table of contents

---
 src/pages/cv.tsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/pages/cv.tsx')

diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx
index de63ec6..44d943c 100644
--- a/src/pages/cv.tsx
+++ b/src/pages/cv.tsx
@@ -1,4 +1,5 @@
 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';
@@ -17,9 +18,16 @@ const CV: NextPageWithLayout<PageProps> = ({ page }) => {
       <article>
         <header>
           <h1>{page.title}</h1>
-          <div dangerouslySetInnerHTML={{ __html: page.intro }}></div>
+          {page.content && (
+            <div dangerouslySetInnerHTML={{ __html: page.intro }}></div>
+          )}
         </header>
-        <div dangerouslySetInnerHTML={{ __html: page.content }}></div>
+        <ToC />
+        <div
+          dangerouslySetInnerHTML={{
+            __html: page.content ? page.content : page.intro,
+          }}
+        ></div>
       </article>
     </>
   );
-- 
cgit v1.2.3

