File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
docusaurus-search-local/src/server/utils Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,14 @@ export function postBuildFactory(
4848 for ( const doc of documents ) {
4949 if ( doc . u . startsWith ( baseUrl ) ) {
5050 const uri = doc . u . substring ( baseUrl . length ) ;
51- let matchedPath : string | undefined ;
51+ let matchedPathes : string [ ] = [ ] ;
5252 for ( const _path of searchContextByPaths ) {
5353 const path = typeof _path === "string" ? _path : _path . path ;
5454 if ( uri === path || uri . startsWith ( `${ path } /` ) ) {
55- matchedPath = path ;
56- break ;
55+ matchedPathes . push ( path ) ;
5756 }
5857 }
59- if ( matchedPath ) {
58+ for ( const matchedPath of matchedPathes ) {
6059 let dirAllDocs = docsByDirMap . get ( matchedPath ) ;
6160 if ( ! dirAllDocs ) {
6261 dirAllDocs = [ ] ;
@@ -67,9 +66,9 @@ export function postBuildFactory(
6766 dirAllDocs [ docIndex ] = dirDocs = [ ] ;
6867 }
6968 dirDocs . push ( doc ) ;
70- if ( ! useAllContextsWithNoSearchContext ) {
71- continue ;
72- }
69+ }
70+ if ( matchedPathes . length > 0 && ! useAllContextsWithNoSearchContext ) {
71+ continue ;
7372 }
7473 }
7574 rootAllDocs [ docIndex ] . push ( doc ) ;
You can’t perform that action at this time.
0 commit comments