easyops-cn / docusaurus-search-local

Offline/local search for Docusaurus v2/v3
https://easyops-cn.github.io/docusaurus-search-local/
MIT License
705 stars 90 forks source link

Embed `search-index.json` into a js file for Docusaurus Hash Router #466

Open yell0wsuit opened 5 hours ago

yell0wsuit commented 5 hours ago

Since JSON is not allowed to be loaded through the file:// protocol, we need to update this so that when using the Hash Router option, the search-index.json is embedded into a JS file to allow local search.

weareoutman commented 5 hours ago

Does even the search-index.json look correct when using the hash router?

See #448 and https://github.com/facebook/docusaurus/issues/3825#issuecomment-2219789003