File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,13 +12,14 @@ export type BreadcrumbT = {
1212
1313export const Breadcrumbs = ( ) => {
1414 const router = useRouter ( )
15- const pathWithLocale = `/${ router . locale } ${ router . asPath . split ( '?' ) [ 0 ] } ` // remove query string
15+ // remove query string and hash
16+ const pathWithLocale = `/${ router . locale } ${ router . asPath . split ( '?' ) [ 0 ] . split ( '#' ) [ 0 ] } `
1617 const { breadcrumbs } = useMainContext ( )
1718
1819 return (
1920 /*
20- NOTE: The breadcrumbs class and the nav tag are used by the
21- LUNR search scripts. The a tag generated by the Link is also used.
21+ NOTE: The breadcrumbs class and the nav tag are used by the
22+ Lunr search scripts. The a tag generated by the Link is also used.
2223 If these change, please also change
2324 updating script/search/parse-page-sections-into-records.js.
2425 */
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ export const SidebarProduct = () => {
3030 }
3131
3232 const productTitle = currentProductTree . renderedShortTitle || currentProductTree . renderedFullTitle
33- const routePath = `/${ router . locale } ${ router . asPath . split ( '?' ) [ 0 ] } ` // remove query string
33+ // remove query string and hash
34+ const routePath = `/${ router . locale } ${ router . asPath . split ( '?' ) [ 0 ] . split ( '#' ) [ 0 ] } `
35+
3436 const hasExactCategory = ! ! currentProductTree . childPages . find ( ( { href } ) =>
3537 routePath . includes ( href )
3638 )
You can’t perform that action at this time.
0 commit comments