Skip to content

Commit

Permalink
Fix breadcrumbs metadata (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding authored Oct 22, 2024
1 parent 3dcd0dc commit 948e519
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/funny-experts-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@jpmorganchase/mosaic-site-components': patch
---

Fixed pages with breadcrumbs having an empty breadcrumb meta
4 changes: 3 additions & 1 deletion packages/site-components/src/Metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const Metadata: React.FC<MetadataProps> = ({ Component = 'head' }) => {
{meta.title && <title>{meta.title}</title>}
{meta.description && <meta name="description" content={meta.description} />}
{session?.user?.image && <link as="image" href={session.user.image} rel="preload" />}
{meta.breadcrumbs && <meta content={JSON.stringify(meta.breadcrumbs)} name="breadcrumbs" />}
{Array.isArray(meta.breadcrumbs) && meta.breadcrumbs.length > 0 && (
<meta content={JSON.stringify(meta.breadcrumbs)} name="breadcrumbs" />
)}
</Component>
);
};

0 comments on commit 948e519

Please sign in to comment.