Skip to content

Commit 1bac760

Browse files
authored
[Docs Site] Add key in ProductCatalog component and hide breadcrumbs (#19250)
1 parent 1b8c94a commit 1bac760

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/components/ProductCatalog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const ProductCatalog = ({ products }: { products: ProductData[] }) => {
110110
{productList.map((product) => {
111111
return (
112112
<a
113+
key={product.data.name}
113114
href={product.data.product.url}
114115
className="block self-stretch rounded-md border border-solid border-gray-200 p-3 !text-inherit no-underline hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800"
115116
>

src/pages/products.astro

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro";
66
import { getIconData, iconToSVG } from "@iconify/utils";
77
import ProductCatalog from "~/components/ProductCatalog";
88
import type { ProductData } from "~/components/ProductCatalog";
9+
import type { StarlightPageProps } from "@astrojs/starlight/props";
910
1011
let products: CollectionEntry<"products">[] = await getCollection(
1112
"products",
@@ -31,15 +32,18 @@ let productData: ProductData[] = products.map((product) => {
3132
};
3233
});
3334
34-
const frontmatter = {
35-
title: "Products",
36-
description:
37-
"API reference, how-to guides, tutorials, example code, and more.",
38-
template: "splash",
39-
} as const;
35+
const props = {
36+
frontmatter: {
37+
title: "Products",
38+
description:
39+
"API reference, how-to guides, tutorials, example code, and more.",
40+
template: "splash",
41+
},
42+
hideBreadcrumbs: true,
43+
} as StarlightPageProps;
4044
---
4145

42-
<StarlightPage frontmatter={frontmatter}>
46+
<StarlightPage {...props}>
4347
<ProductCatalog products={productData} client:load />
4448
</StarlightPage>
4549

0 commit comments

Comments
 (0)