Skip to content
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

Provide a configuration to specify baseUrl or path to generated Search/Lunr JSON files #122

Closed
nobeh opened this issue Oct 10, 2023 · 3 comments

Comments

@nobeh
Copy link

nobeh commented Oct 10, 2023

When the plugin is being loaded, it uses siteConfig from docusaurus:

https://github.com/praveenn77/docusaurus-lunr-search/blob/main/src/theme/SearchBar/index.jsx#L15-L16

which defaults to baseUrl and this is used to load the generated JSON files:

https://github.com/praveenn77/docusaurus-lunr-search/blob/main/src/theme/SearchBar/index.jsx#L55-L57

This assumes that the same directory/file structure is accessible after deployment. However, imagine that the deployment would be in such a way that the /search-doc.json would be accessible via /assets/search-doc.json.

It'd be great if the baseUrl (or filenames.{searchDoc, lunrIndex}) would be a configuration so that the user could specify on how to load them on different environments.

@nobeh
Copy link
Author

nobeh commented Oct 10, 2023

Seems to be also related to a similar issue at #80

@praveenn77
Copy link
Owner

assetUrl option added in new version 3.1.0.
Thanks

@nobeh
Copy link
Author

nobeh commented Oct 16, 2023

Thanks for your support on this 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants