docusaurus
docusaurus copied to clipboard
Fix search
fix https://github.com/wechaty/wechaty.js.org/issues/666
fix No results were found
in https://wechaty.js.org/search
see changes: https://github.com/l3ob/wechaty.js.org/commit/ec8cf2344d7dc61fe24666d360288378252dd0a5 https://github.com/l3ob/wechaty.js.org/commit/96c1bec5fd25de8cd867df5e071a1ac01c67a50a https://github.com/l3ob/wechaty.js.org/commit/be6ba90f4f640dce93296bf2ba5e28d594e4e699
@huan PR reopened here with clarification of changes
ping @huan
@lijiarui Thanks for pinging me.
@l3ob Thank you very much for trying to fix the search feature on our website!
It seems that you have modified a lot of source code. My questions is:
- Does those changes are necessary / MUST? If so, I believe the docusaurus system need to be improved, which means that we should submit a PR to the docusaurus project, to fix our upper stream.
- If the docusaurus system is good (which I believe this is true, because there are lots of projects are using the docusaurus project and the search function on their site is work without any problem), then we should not change the source code of the docusaurus system
- Due to the above 2 points, I believe what we need to fix is the configuration of our website.
So could you please help us to understand the reason of the search functionality of the wechaty website does not work by explaining in detail?
We need to understand the reason first, then we can see what is the best way to fix it. (I would like to expect that we can fix it by change our configurations only)
P.S. Please always keep working on one PR and keep improving it, instead of close one and open another, because we should always keep the conversation and the improvements linked together, which can be achieved by keeping improving one PR.
@huan the modification of SearchBar to fix https://github.com/wechaty/wechaty.js.org/issues/666 is just changing router redirect to browser redirect
all changes are in this commit https://github.com/l3ob/wechaty.js.org/commit/ec8cf2344d7dc61fe24666d360288378252dd0a5 others are copying source code
the reason of the problem is routing system can only work within docusaurus project but the articles in the website are outside docusaurus project so the routing system returns 404 page
the change of SearchPage in this commit https://github.com/l3ob/wechaty.js.org/commit/be6ba90f4f640dce93296bf2ba5e28d594e4e699
but I have no idea what is exactly wrong with it I just tried to modify the request params and it worked
ping @huan
@l3ob Thanks for the comments, I have the following questions:
- According to your commits (l3ob@ec8cf23, l3ob@96c1bec, l3ob@be6ba90), they are just changing a few lines of the code, but why this PR includes so many new codes?
- https://github.com/l3ob/wechaty.js.org/commit/ec8cf2344d7dc61fe24666d360288378252dd0a5 : why you change
to
tohref
? what's the problem and what you have fixed by changing this? - https://github.com/l3ob/wechaty.js.org/commit/96c1bec5fd25de8cd867df5e071a1ac01c67a50a : same question as above
- https://github.com/l3ob/wechaty.js.org/commit/be6ba90f4f640dce93296bf2ba5e28d594e4e699 : it seems not right by documenting out all the code.
P.S.: And what you are trying to fix exactly? I can use the search for our docs without any problem:
@huan
-
they are just changing a few lines of the code, but why this PR includes so many new codes?
according to https://docusaurus.io/docs/search#editing-the-algolia-search-component the new codes are copy of component code in the npm module
-
why you change to to href? what's the problem and what you have fixed by changing this?
the search results in docs works ok, but the search results in blogs not work try search "微信" and click on the search result (BUG_1)
and try to click "See all xxx results" on the bottom (BUG_2)
change to to href can fix BUG_1
-
it seems not right by documenting out all the code.
It seems not right to me too, but changing this can fix BUG_2 in my local running
ping @l3ob
Hi @l3ob
Thank you very much for this improvement, however, that's lots of code that I'm not familiar with.
Will try to investigate them when I got time!
I think #1509 will fix the search (hopefully).
Please let me know if you think this PR needs to be kept open.
Thanks!