New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ignoreCssSelectors option #348
Add ignoreCssSelectors option #348
Conversation
✅ Deploy Preview for easyops-cn-docusaurus-search-local ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
eef8a7e
to
e9f7794
Compare
@weareoutman do you think you'll have time to look at this? I'm just thinking if I should look into deploying it as a fork. |
README.md
Outdated
@@ -87,6 +87,7 @@ module.exports = { | |||
| searchResultContextMaxLength | number | `50` | Set the max length of characters of each search result to show. | | |||
| explicitSearchResultPath | boolean | `false` | Whether an explicit path to a heading should be presented on a suggestion template. | | |||
| ignoreFiles | string \| RegExp \| (string \| RegExp)[] | `[]` | Set the match rules to ignore some routes. Put a string if you want an exact match, or put a regex if you want a partial match. Note: without the website base url. | | |||
| ignoreClasses | string \| string[] | `[]` | A list of html classes to ignore when indexing each page. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contributions! How about change this option to ignoreCssSelectors
? So that users can ignore not only by classes, but also by other css selectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, not sure why I didn't do that from the start :) Fixed it!
…s selector instead of just classes
f8605c6
to
4e2bc60
Compare
Thanks, released v0.36.0 |
I found myself in need of ignoring more custom elements from the search indexing so I thought this would be a good additional option to make the plugin even more flexible.
I also took the time to fix so that the tests complete fine on Windows with the differing path separators.