summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-20 22:48:30 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-20 22:48:30 +0100
commitf4ffab2585bc6aedfc696c62f71d058a0eac0274 (patch)
treefdb8b5abd33f0207b8d3a46a12ef5bfd17d36d77 /src
parent50a3df40bc8d41271c4cd8d6873a6d4e1dd87b42 (diff)
chore: include projects inside breadcrumb
Diffstat (limited to 'src')
-rw-r--r--src/components/Breadcrumb/Breadcrumb.tsx23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/components/Breadcrumb/Breadcrumb.tsx b/src/components/Breadcrumb/Breadcrumb.tsx
index 0b9977e..7c8eb5c 100644
--- a/src/components/Breadcrumb/Breadcrumb.tsx
+++ b/src/components/Breadcrumb/Breadcrumb.tsx
@@ -11,8 +11,9 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
const isHome = router.pathname === '/';
const isArticle = router.pathname.includes('/article/');
- const isThematic = router.pathname.includes('/thematique/');
+ const isProject = router.pathname.includes('/projet/');
const isSubject = router.pathname.includes('/sujet/');
+ const isThematic = router.pathname.includes('/thematique/');
const getItems = () => {
return (
@@ -31,6 +32,15 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
</li>
</>
)}
+ {isProject && (
+ <>
+ <li className={styles.item}>
+ <Link href="/projets">
+ <a>{t`Projects`}</a>
+ </Link>
+ </li>
+ </>
+ )}
<li className="screen-reader-text">{pageTitle}</li>
</>
);
@@ -58,6 +68,17 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
items.push(blog);
}
+ if (isProject) {
+ const blog: BreadcrumbList['itemListElement'] = {
+ '@type': 'ListItem',
+ position: 2,
+ name: t`Projects`,
+ item: `${config.url}/projets`,
+ };
+
+ items.push(blog);
+ }
+
const currentPage: BreadcrumbList['itemListElement'] = {
'@type': 'ListItem',
position: items.length + 1,