-
Notifications
You must be signed in to change notification settings - Fork 839
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
feat: add search to the new documentation website #7878
Conversation
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.
I see the search includes algolia
in it's id
s here 😅 I guess in theory we could eject it and update? Not sure how spaghetti this might be 🤔
❓ Do we have an idea about the styling of the search popover? Maybe we could at least align colors? This could be a separate task?
@@ -19,12 +19,12 @@ const getContentStyles = ({ euiTheme }: UseEuiTheme) => { | |||
}; | |||
|
|||
/* OriginalContent holds the document title and markdown content | |||
NOTE: ejecting this results in an error due to using useDoc() hook outside of DocProvider | |||
NOTE: ejecting this results in an error due to using useDoc() hook outside of DocProvider |
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.
ℹ️ It'll be ejected in this PR.
To prevent the error around useDoc
we need to eject the entire related component to ensure same context/providers. 🙈
@mgadewoll I considered ejecting it, but it's pretty complicated, and I wanted to avoid it in this PR. We will improve it later but now the goal is to just have local search |
Just to clarify, you mean because of the algolia references? |
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.
🚢 🐈⬛ This plugin is a nice initial setup! I think we could even extend the search capabilities when ejecting the components 🤔 (EuiButton vs Button for example) But we can iterate as needed 👍
After the content updates are merged, you'll need to rebase to the ejected DocItem contents. Let me know if there is any trouble!
299bbc0
to
14b99bb
Compare
💚 Build Succeeded
History
cc @tkajtoch |
Summary
This resolves #7877 by integrating
docusaurus-lunr-search
and adding a data attribute to inform it what content to index.QA
button
and confirm there are multiple search results pointing to different documentation sections, for example:Button
,Empty button
,Split buttons
,Icon buttons