vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.27k stars 925 forks source link

[Bug report] Docsearch not working #217

Closed Mister-Hope closed 3 years ago

Mister-Hope commented 3 years ago

Here is my website: https://waline.js.org (It has a lang attr on html)

It's not working because @vuepress/docsearch plugin is force adding facetFilters: ['lang:xxx'] while the default vuepress2 docsearch template (I am not sure how docsearch is generating clawer config files for vuepress2 website) is not supporting it.

I will post on this repo first. @meteorlxy @shortcuts

meteorlxy commented 3 years ago

We have a note in the docs:

https://github.com/vuepress/vuepress-next/blob/207014b087d29f43bd01604954e33277b6b19150/docs/reference/plugin/docsearch.md#L53

Submit a PR directly to that repo: https://github.com/algolia/docsearch-configs/blob/master/configs/waline.json

Mister-Hope commented 3 years ago

Got it, but I recommand you to move it outside the details block. That's why I missed it. I will also try to warn algolia for that when sites using vuepress2 are requesting docsearch.

image

meteorlxy commented 3 years ago

Hi @shortcuts, could your team help to add those fields when a site is using VuePress 2?

You can identify the generator according to the <meta name="generator"> tag:

image

shortcuts commented 3 years ago

Hey @Mister-Hope, @meteorlxy

I just realized that our config generator didn't picked the vuepress template, I'll dig in our scraper to see where's the issue!

Thanks to both of you for pointing that out!