Skip to content

Commit 871b739

Browse files
KianNHGregBrimble
authored andcommitted
[Docs Site] Don't show breadcrumbs on /products/ (#17240)
* [Docs Site] Remove duplicate breadcrumb on /products/ * Don't show breadcrumbs at all on /products/ * Update src/components/overrides/PageTitle.astro Co-authored-by: Greg Brimble <[email protected]> --------- Co-authored-by: Greg Brimble <[email protected]>
1 parent ad5e4fb commit 871b739

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

src/components/overrides/PageTitle.astro

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const updated = Astro.props.entry.data.updated;
1919
const badge = Astro.props.entry.data.sidebar?.badge;
2020
const summary = Astro.props.entry.data.summary;
2121
22+
const slug = Astro.props.entry.slug;
23+
24+
const showBreadcrumbs = !["products"].includes(slug);
25+
2226
const breadcrumbProps: Record<string, any> = {
2327
crumbs: [
2428
{
@@ -30,8 +34,6 @@ const breadcrumbProps: Record<string, any> = {
3034
id: "breadcrumbs",
3135
};
3236
33-
const slug = Astro.props.entry.slug;
34-
3537
const segments = slug.split("/");
3638
3739
for (let i = 0; i < segments.length; i++) {
@@ -73,21 +75,27 @@ for (let i = 0; i < segments.length; i++) {
7375
const hideTitle = Astro.props.hideTitle;
7476
---
7577

76-
<Breadcrumbs {...breadcrumbProps}>
77-
<svg
78-
slot="separator"
79-
xmlns="http://www.w3.org/2000/svg"
80-
width="24"
81-
height="24"
82-
viewBox="0 0 24 24"
83-
fill="none"
84-
stroke="currentColor"
85-
stroke-width="2"
86-
stroke-linecap="round"
87-
stroke-linejoin="round"
88-
><polyline points="9 18 15 12 9 6"></polyline>
89-
</svg>
90-
</Breadcrumbs>
78+
{
79+
showBreadcrumbs && (
80+
<Breadcrumbs {...breadcrumbProps}>
81+
<svg
82+
slot="separator"
83+
xmlns="http://www.w3.org/2000/svg"
84+
width="24"
85+
height="24"
86+
viewBox="0 0 24 24"
87+
fill="none"
88+
stroke="currentColor"
89+
stroke-width="2"
90+
stroke-linecap="round"
91+
stroke-linejoin="round"
92+
>
93+
<polyline points="9 18 15 12 9 6" />
94+
</svg>
95+
</Breadcrumbs>
96+
)
97+
}
98+
9199
{!hideTitle && <Default {...Astro.props} />}
92100

93101
{badge && <Badge variant={badge.variant} text={badge.text} />}

0 commit comments

Comments
 (0)