diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-21 14:29:19 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-21 14:29:19 +0100 |
| commit | a367f605b842ad0a71a63025da15ac62ed0364a5 (patch) | |
| tree | b15150fbe219d1905b98570ebafb5063d0ade1b1 /src/pages/blog | |
| parent | 6092ad0c91e0dc268e5988174db87ded14e6c931 (diff) | |
chore: add a breadcrumb component
Diffstat (limited to 'src/pages/blog')
| -rw-r--r-- | src/pages/blog/index.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index 7d34763..23013bd 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -1,8 +1,7 @@ -import { ReactElement } from 'react'; import { GetStaticProps } from 'next'; import Head from 'next/head'; import { t } from '@lingui/macro'; -import Layout from '@components/Layouts/Layout'; +import { getLayout } from '@components/Layouts/Layout'; import { seo } from '@config/seo'; import { config } from '@config/website'; import { NextPageWithLayout } from '@ts/types/app'; @@ -62,9 +61,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { ); }; -Blog.getLayout = function getLayout(page: ReactElement) { - return <Layout>{page}</Layout>; -}; +Blog.getLayout = getLayout; export const getStaticProps: GetStaticProps = async (context) => { const translation = await loadTranslation( @@ -72,9 +69,11 @@ export const getStaticProps: GetStaticProps = async (context) => { process.env.NODE_ENV === 'production' ); const data = await getPublishedPosts({ first: config.postsPerPage }); + const breadcrumbTitle = t`Blog`; return { props: { + breadcrumbTitle, fallback: { '/api/posts': data, }, |
