From a367f605b842ad0a71a63025da15ac62ed0364a5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 21 Dec 2021 14:29:19 +0100 Subject: chore: add a breadcrumb component --- src/pages/article/[slug].tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/pages/article') diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index bb11220..621b2e2 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -1,6 +1,6 @@ import CommentForm from '@components/CommentForm/CommentForm'; import CommentsList from '@components/CommentsList/CommentsList'; -import Layout from '@components/Layouts/Layout'; +import { getLayout } from '@components/Layouts/Layout'; import PostFooter from '@components/PostFooter/PostFooter'; import PostHeader from '@components/PostHeader/PostHeader'; import { t } from '@lingui/macro'; @@ -11,7 +11,6 @@ import { loadTranslation } from '@utils/helpers/i18n'; import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; import Head from 'next/head'; import { ParsedUrlQuery } from 'querystring'; -import { ReactElement } from 'react'; const SingleArticle: NextPageWithLayout = ({ post }) => { const { @@ -53,9 +52,7 @@ const SingleArticle: NextPageWithLayout = ({ post }) => { ); }; -SingleArticle.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; +SingleArticle.getLayout = getLayout; interface PostParams extends ParsedUrlQuery { slug: string; @@ -70,9 +67,11 @@ export const getStaticProps: GetStaticProps = async ( ); const { slug } = context.params as PostParams; const post = await getPostBySlug(slug); + const breadcrumbTitle = post.title; return { props: { + breadcrumbTitle, post, translation, }, -- cgit v1.2.3