emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
238 stars 30 forks source link

Add option to allow/ignore file paths matching regexes or globs #56

Closed Pandapip1 closed 1 year ago

Pandapip1 commented 1 year ago

Suggested API:

 var options = {
   ...flexSearchIndexOptions,
   previewLength: 62,
   buttonLabel: "Search",
   placeholder: "Search docs",
+  allow: [ // If present with non-zero length, file paths NOT matching one of these regexes will be discarded
+    /someregex/g
+  ],
+  ignore: [ // If present with non-zero length, file paths matching at least one of these regexes will be discarded
+    /someregex2/g
+  ],
 };

(If both are present, files must not match any ignore pattern AND must match an allow pattern)

puyt commented 1 year ago

any update? I can't use the plugin atm because it keeps finding results inside node_modules

emersonbottero commented 1 year ago

have you try version 19? I ignore node_modules in that version.

puyt commented 1 year ago

have you try version 19? I ignore node_modules in that version.

Yes it's working with this PR, thx :+1:

Pandapip1 commented 1 year ago

Thank you! I'll check it out.