-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Update search to DocSearch v3 #32098
Conversation
Thanks for the PR, but I see many unrelated stuff.
I think at this point we are better off dropping this PR and we open an issue when docsearch 1.0.0 is stable. |
var origin = location.origin | ||
function IconName(hit) { | ||
return hit.url | ||
.replace(/https:\/\/icons.getbootstrap.com\/icons\//g, '') |
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.
.replace(/https:\/\/icons.getbootstrap.com\/icons\//g, '') | |
.replace(/https:\/\/icons\.getbootstrap\.com\/icons\//g, '') |
|
||
origin = location.protocol + '//' + location.hostname + port | ||
function Hits({ hit, children }) { |
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.
based on the lint error, I think destructuring might not be allowed in this file
var currentUrl = getOrigin() | ||
var liveUrl = 'https://getbootstrap.com/' | ||
|
||
hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0 ? |
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.
the url replacing code likely needs to be put back in the v3
@s-pace if there is something needed from our side let me know. Please see my above points :) |
Hi @XhmikosR , I feel we might have rushed the PR and the description didn't really help since there are so many things that would need us to discuss but we focused on presenting the new version of DocSearch. What we had in mind is more trying to open the conversation around a POC. This would help us align the stuff we learned about documentation search with your deep knowledge of the community usage. This proposition was indeed more about providing a search for the icons but I believe there is an opportunity to create a better unified experience with Bootstrap V5 and the new version of DocSearch without disrupting the current search of all anterior versions (so the usage and browser support). Feel free to join our Discord server to chat about the possibilities that this new version offers, or to jump into my Twitter DMs. |
@Shipow All good, it wasn't clear indeed that this was a PoC. That being said, I still don't see why we'd like to combine the icons project with the main one; they are 2 separate projects. Also,
But like I said, I still don't see why we would want to merge 2 different projects. If/when docsearch 3 is stable enough and we have the time to make the switch, happy to do it then. |
@XhmikosR I'll try to resume the logic that made us think that it is a good improvement to enable search across multiple projects. An important limitation in the current setup is for users who want to search the docs but cannot access it from the homepage. The current positioning of the search is less accessible because it restricted to the documentation and positioned in it's subnav. We designed DocSearch V3 to live in the top nav, it can now understand the page context, prioritize and filter results from different sources, when Mark requested a search for icons it seemed fair to assume that the search could find a better place at top level. Users would benefit from direct access to all resource of the ecosystem. It's a huge accelerator.
I think the Icon project has a brilliant future, it might really be handy to access them from the docs (eventually only if user starts the query by Let's make Bootstrap users benefit from the new features and everything else we learned since the implementation of the current version. Again, happy to discuss more about that, being here or in a call |
Hello Bootstrap team!
After @mdo requested a DocSearch for the icons website, we thought it was time to bring the Bootstrap search documentation to the next level.
This PR integrates the new version of DocSearch, that better reflects what we think documentation search should be.
It has the advantage to bring results from the documentation but also the icon library where we use a dedicated template to display the icons directly in the search making it straightforward to identify the right one.
Description
Reducing users' efforts to get them started integrating your product is key to adoption. We created DocSearch in 2015 as a community effort to solve this problem.
We've had time to try different approaches since then and would like to propose you a new documentation search experience.
This new experience has been well received and is now live on the Docusaurus v2 integrations, TailwindCSS, React Native, and we working closely with some others major OSS projects.
Preview
Changes
You can read about all the new features in the Docusaurus PR (facebook/docusaurus#2815), but here's a summary:
Ctrl+K
,⌘+K
or/
The bundle size decreased and we now provide React components which can be lazy loaded.
What's next
This new DocSearch version has been used in production for a couple of months now.
This version is marked as alpha for now because the underlying libraries that we use (e.g.,
autocomplete-core
) are still being worked on at @algolia to make sure that it handles more cases than DocSearch and usual autocomplete search experiences. We plan to go stable in the coming weeks but no major changes will happen to DocSearch.Let us know what you think!
Possible improvement
Navbar vs Subnav
The SearchBox is currently located in the subnav which is the sticky element.
With this multi-index search, it would make more sense to merge the navs together and make the navbar the sticky one. This feature will allow you to implement your search experience from any pages.
What's this PR doesn't include:
Links