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

Lunr.js implementation in default template creates gh-pages build timeout with larger blogs #42

Open
lrdj opened this issue Mar 20, 2020 · 0 comments

Comments

@lrdj
Copy link

lrdj commented Mar 20, 2020

Great to have a turnkey Lunr.js implementation in the template. I'm a big fan of Lunr and this is so easy to get started with so once again, thanks for your great work:-)

I have 2000 posts on my blog and this caused a build timeout on gh-pages. Once source of timeout was building the Lunr index file into every post.

I changed your template so that the index is built just once and then called via <script> in each post. I also truncated the text that gets indexed to reduce the size of the index file. If I was more clever I'd break it into a 'search' experience and an 'advance search' experience where the advanced search would do a lazy loading of a larger index file. Maybe for another time...

I've broken the process into separate files using includes:
_includes/search-lunr.html

and also building the index as a page:
_pages/build-lunr-index.html

It still works:
lunr-on-donkey

If any of this is useful let me know and I'll try and package it up a bit more sensibly and do a pull request.

Template hacks are in my repo:
https://github.com/lrdj/donkey

@lrdj lrdj changed the title Lunr implementation in default template creates overload with larger blogs Lunr.js implementation in default template creates overload with larger blogs Mar 20, 2020
@lrdj lrdj changed the title Lunr.js implementation in default template creates overload with larger blogs Lunr.js implementation in default template creates gh-pages build timeout with larger blogs Mar 20, 2020
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

1 participant