File tree Expand file tree Collapse file tree 1 file changed +25
-17
lines changed Expand file tree Collapse file tree 1 file changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ const updated = Astro.props.entry.data.updated;
1919const badge = Astro .props .entry .data .sidebar ?.badge ;
2020const summary = Astro .props .entry .data .summary ;
2121
22+ const slug = Astro .props .entry .slug ;
23+
24+ const showBreadcrumbs = ! [" products" ].includes (slug );
25+
2226const 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-
3537const segments = slug .split (" /" );
3638
3739for (let i = 0 ; i < segments .length ; i ++ ) {
@@ -73,21 +75,27 @@ for (let i = 0; i < segments.length; i++) {
7375const 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 } />}
You can’t perform that action at this time.
0 commit comments