From 16ba7afe8fad415a1e34af466c316df56e86b87e Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Thu, 17 Feb 2022 10:37:34 +0800 Subject: [PATCH 1/3] feat: add SEO microdata for doc breadcrumbs --- .../src/theme/DocBreadcrumbs/index.tsx | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx index 8eecbe54170a..a11f844d1b10 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx @@ -22,11 +22,13 @@ function BreadcrumbsItemLink({ }): JSX.Element { const className = clsx('breadcrumbs__link', styles.breadcrumbsItemLink); return href ? ( - - {children} + + {children} ) : ( - {children} + + {children} + ); } @@ -34,26 +36,35 @@ function BreadcrumbsItemLink({ function BreadcrumbsItem({ children, active, + position, }: { children: ReactNode; active?: boolean; + position?: string; }): JSX.Element { return (
  • {children} +
  • ); } function HomeBreadcrumbItem() { - const homeHref = useBaseUrl('/'); return ( - - 🏠 - +
  • + + 🏠 + +
  • ); } @@ -71,10 +82,16 @@ export default function DocBreadcrumbs(): JSX.Element | null { styles.breadcrumbsContainer, )} aria-label="breadcrumbs"> -