From 2155550fa36a3bc3c8f66e0926530123b4018cd4 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 16 May 2022 12:46:38 +0200 Subject: refactor: use custom hook for breadcrumb items and schema --- src/pages/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/pages/index.tsx') diff --git a/src/pages/index.tsx b/src/pages/index.tsx index bc9b572..1143a33 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -19,6 +19,7 @@ import { getArticlesCard } from '@services/graphql/articles'; import styles from '@styles/pages/home.module.scss'; import { ArticleCard } from '@ts/types/app'; import { loadTranslation, type Messages } from '@utils/helpers/i18n'; +import useBreadcrumb from '@utils/hooks/use-breadcrumb'; import useSettings from '@utils/hooks/use-settings'; import { NestedMDXComponents } from 'mdx/types'; import { GetStaticProps, NextPage } from 'next'; @@ -38,6 +39,10 @@ type HomeProps = { */ const HomePage: NextPage = ({ recentPosts }) => { const intl = useIntl(); + const { schema: breadcrumbSchema } = useBreadcrumb({ + title: '', + url: `/`, + }); /** * Retrieve a list of coding links. @@ -322,7 +327,7 @@ const HomePage: NextPage = ({ recentPosts }) => { }; return ( - + {pageTitle} @@ -340,7 +345,7 @@ const HomePage: NextPage = ({ recentPosts }) => { ); }; -export const getStaticProps: GetStaticProps = async ({ locale }) => { +export const getStaticProps: GetStaticProps = async ({ locale }) => { const translation = await loadTranslation(locale); const recentPosts = await getArticlesCard({ first: 3 }); -- cgit v1.2.3