From 606461f857e06b06429dd5738be642f9d1b459be Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 11 Jan 2022 16:20:59 +0100 Subject: chore: add title and meta desc to subjects and thematics --- src/pages/sujet/[slug].tsx | 57 ++++++++++++++++++++++++----------------- src/pages/thematique/[slug].tsx | 47 +++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 43 deletions(-) (limited to 'src/pages') diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index 167bfc0..a7adf89 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -16,6 +16,7 @@ import { ArticleMeta } from '@ts/types/articles'; import ToC from '@components/ToC/ToC'; import { RelatedThematics, TopicsList } from '@components/Widget'; import { useRef } from 'react'; +import Head from 'next/head'; const Subject: NextPageWithLayout = ({ subject }) => { const relatedThematics = useRef([]); @@ -49,30 +50,38 @@ const Subject: NextPageWithLayout = ({ subject }) => { }; return ( -
- - -
-
- {subject.posts.length > 0 && ( -
-

{t`All posts in ${subject.title}`}

-
    {getPostsList()}
-
- )} -
- -
+ <> + + {subject.seo.title} + + +
+ + +
+
+ {subject.posts.length > 0 && ( +
+

{t`All posts in ${subject.title}`}

+
    {getPostsList()}
+
+ )} +
+ +
+ ); }; diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index 4921806..f23ad5b 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -16,6 +16,7 @@ import ToC from '@components/ToC/ToC'; import { RelatedTopics, ThematicsList } from '@components/Widget'; import { useRef } from 'react'; import { ArticleMeta } from '@ts/types/articles'; +import Head from 'next/head'; const Thematic: NextPageWithLayout = ({ thematic }) => { const relatedSubjects = useRef([]); @@ -48,25 +49,33 @@ const Thematic: NextPageWithLayout = ({ thematic }) => { }; return ( -
- - -
-
- {thematic.posts.length > 0 && ( -
-

{t`All posts in ${thematic.title}`}

-
    {getPostsList()}
-
- )} -
- -
+ <> + + {thematic.seo.title} + + +
+ + +
+
+ {thematic.posts.length > 0 && ( +
+

{t`All posts in ${thematic.title}`}

+
    {getPostsList()}
+
+ )} +
+ +
+ ); }; -- cgit v1.2.3