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

Add search functionality based on @antora/lunr-extension #1859

Merged
merged 1 commit into from
May 5, 2022

Conversation

sake92
Copy link
Contributor

@sake92 sake92 commented May 4, 2022

CSS and JS are copied from node_modules, I followed instructions from here https://gitlab.com/antora/antora-lunr-extension
The index itself is around 600+KB so it doesnt add too much to the site.

This is how it looks like from local:
image

@lefou
Copy link
Member

lefou commented May 5, 2022

Nice. Is that supposed to work with mill docs.antora.localPages? I see the search box, but typing anything in it does not reveal any result or result box.

@sake92
Copy link
Contributor Author

sake92 commented May 5, 2022

@lefou yes, that screenshot is from my local setup. Not sure why it doesnt work for you, any errors in browser console? Maybe try clean build again.

@lefou
Copy link
Member

lefou commented May 5, 2022

Nothing in console. But I noticed there is no reference to any docsearch script in the page source. Probably an issue in the build, not the browser.

@lefou
Copy link
Member

lefou commented May 5, 2022

Could it be my system is picking another version of antora which doesn't not include the search-scripts.js by default? I added it manually, and then it worked for me, too.

Shall I open a PR to your branch?

@lefou
Copy link
Member

lefou commented May 5, 2022

Let's merge this as-is. If it not works out-of-the-box, as it does for you, fine. If not, I can push my fixes afterwards.

@lefou lefou merged commit bc1c5cd into com-lihaoyi:main May 5, 2022
@lefou lefou added this to the after 0.10.3 milestone May 5, 2022
@lefou
Copy link
Member

lefou commented May 5, 2022

Thank you!

@sake92
Copy link
Contributor Author

sake92 commented May 5, 2022

You're welcome! Seems it works fine on the live site. 🥳

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

Successfully merging this pull request may close these issues.

2 participants