File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
versioned_docs/version-v3 Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -296,12 +296,14 @@ new Crawler({
296296 pathsToMatch: [' https://YOUR_WEBSITE_URL/**' ],
297297 recordExtractor : ({ $, helpers }) => {
298298 // priority order: deepest active sub list header -> navbar active item -> 'Documentation'
299+ // Extracting the breadcrumb titles for better accessibility.
300+ const navbarTitle = $ (" .navbar__item.navbar__link--active" ).text ();
301+ const pageBreadcrumbTitles = $ (" .breadcrumbs__link" )
302+ .toArray ()
303+ .map ((item ) => $ (item).text ().trim ())
304+ .filter (Boolean );
299305 const lvl0 =
300- $ (
301- ' .menu__link.menu__link--sublist.menu__link--active, .navbar__item.navbar__link--active'
302- )
303- .last ()
304- .text () || ' Documentation' ;
306+ [navbarTitle, ... pageBreadcrumbTitles].join (" / " ) || " Documentation" ;
305307
306308 return helpers .docsearch ({
307309 recordProps: {
Original file line number Diff line number Diff line change @@ -296,12 +296,14 @@ new Crawler({
296296 pathsToMatch: [' https://YOUR_WEBSITE_URL/**' ],
297297 recordExtractor : ({ $, helpers }) => {
298298 // priority order: deepest active sub list header -> navbar active item -> 'Documentation'
299+ // Extracting the breadcrumb titles for better accessibility.
300+ const navbarTitle = $ (" .navbar__item.navbar__link--active" ).text ();
301+ const pageBreadcrumbTitles = $ (" .breadcrumbs__link" )
302+ .toArray ()
303+ .map ((item ) => $ (item).text ().trim ())
304+ .filter (Boolean );
299305 const lvl0 =
300- $ (
301- ' .menu__link.menu__link--sublist.menu__link--active, .navbar__item.navbar__link--active'
302- )
303- .last ()
304- .text () || ' Documentation' ;
306+ [navbarTitle, ... pageBreadcrumbTitles].join (" / " ) || " Documentation" ;
305307
306308 return helpers .docsearch ({
307309 recordProps: {
You can’t perform that action at this time.
0 commit comments