Renovamen / vuepress-theme-gungnir

A blog theme for VuePress 2.
https://v2-vuepress-theme-gungnir.vercel.app
Apache License 2.0
353 stars 79 forks source link

feature: Full Text Search #26

Open RayBenefield opened 2 years ago

RayBenefield commented 2 years ago

Was hoping to add a full text search using vuepress-plugin-fulltext-search, however I realized that this theme does not use the typical SearchBox. Could full text search be an upgrade in the future?

If not, would there be an easy way to replace the current SearchPage in the layout?

Zhengqbbb commented 2 years ago

Consider adding features vuepress2 official plugin - docSearch

Of course, I have tried adding this plugin, but I am also encountering bugs. This problem may originate from the plugin, it has been rendered repeatedly, and I submit an issue.

dan-r95 commented 2 years ago

the problem here is that it can only be used for open source projects. @RayBenefield did u succeed with upgrading the repository to vuepress 2? I could not figure out how actually replace the SearchBox in the code.

Renovamen commented 2 years ago

Hi, sorry for the late reply. I just noticed that vuepress-plugin-fulltext-search isn't working with VuePress 2 as for now, so I can do nothing with theme v2.x. I'll try to support it after it being compatible with Vuepres 2.

I don't plan to add any new features to theme v0.x any more (but PRs are welcome). But if you want to re-write and replace the original SearchPage component, maybe this issue would be helpful. You can also eject and modify the theme.

Zhengqbbb commented 2 years ago

Of course, I have tried adding this plugin, but I am also encountering bugs. This problem may originate from the plugin, it has been rendered repeatedly, and I submit an vuepress-next/issues/607.

@Renovamen I see that you have used the docsearch plugin in the latest version(2.0.0-alpha.17). If you use the keybord to jump to other page from the home page, the pop-up window will not be canceled.

ps: At that time, I also found that it was normal for to use the mouse to pop up the pop-up window to search, so what I did at that time was to css hide the keyboard icon 😂🤣

https://user-images.githubusercontent.com/40693636/157826702-4ea98e0d-94e3-4b23-bfd8-334065ddab07.mp4

Renovamen commented 2 years ago

I see, you mean when using ⌘ + K shortcut to call out the docsearch component and navigating to another page, the docsearch component would not disappear automatically after router changing. I didn't notice that, it should be bug in plugin-docsearch, thank you for pointing it out!

I see that you have used the docsearch plugin in the latest version(2.0.0-alpha.17)

The latest version still uses the built-in search component by default and doesn't add plugin-docsearch to its dependencies, it just becomes compatible with plugin-docsearch. I just use plugin-docsearch in the docs website for a better search experience.

But I'll keep up with any bug fixes for plugin-docsearch.