Add Breadcrumb JSON-LD structured data to a page
seo-in-astro provides the LayoutForBreadcrumb component to easily add Breadcrumb JSON-LD structured data to a page.
Using the LayoutForBreadcrumb component
Section titled “Using the LayoutForBreadcrumb component”-
Import the
LayoutForBreadcrumbcomponent into every page where you want to generate the JSON-LD data.app/products/electronics/laptops.astro ---import LayoutForBreadcrumb from "@dlcastillop/seo-in-astro/LayoutForBreadcrumb";---<LayoutForBreadcrumbtitle="Laptops"description="All our laptops."ogImg="/og-laptops.png"itemList={[{ name: "Home", route: "/" },{ name: "Products", route: "/products" },{ name: "Electronics", route: "/products/electronics" },{ name: "Laptops", route: "/products/electronics/laptops" },]}scriptId="breadcrumb-json-ld"><main><h1>Laptops</h1></main></LayoutForBreadcrumb> -
Check the generated JSON-LD by inspecting the head element of your page.
Related
Section titled “Related”View related API references.
LayoutForBreadcrumb API Reference for the LayoutForBreadcrumb component.