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

Adding search to the theme #40

Closed
pixelastic opened this issue Dec 22, 2017 · 5 comments
Closed

Adding search to the theme #40

pixelastic opened this issue Dec 22, 2017 · 5 comments

Comments

@pixelastic
Copy link

pixelastic commented Dec 22, 2017

Hello, I'm the author of the jekyll-algolia plugin. jekyll-algolia lets you push the content of your Jekyll website to Algolia, so you can then add search capabilities directly from the front-end. (Full disclosure, I work at Algolia).

I've created a live demo of what it looks like on the minima default theme. I wondered if you would be interested in adding something similar to your awesome theme.

image
Animated gif of the previous example

The minima theme is nice for a starter, but I assume most people would like to switch to another theme pretty quickly. I really like yours as it is simple but yet extremely readable and customisable. If you think that would be a valuable addition to the theme, we can collaborate together on that.

Using Algolia requires an account (to get an appId and apiKey), but we provide forever-free community accounts that can hold up to 10k records. In the context of jekyll-algolia, one record will be created for each <p> of content. To give you an idea, I've been blogging for 5+ years and I'm only using 4k records so it's safe to assume it can be used for free for a long time :)

I've written an extended tutorial on how to integrate front-end search into minima, and you can find more information about the actual indexing part (pushing data from Jekyll to Algolia) here. The documentation website is still a WIP but you should be able to find most of the info.

Let me know if you'd be interested in collaborating on that front, I'd be very happy to provide any help I can.

Cheers,

@mmistakes
Copy link
Owner

I think this is a good idea and something I'd be interested in adding. I'd like to give it some thought on how I'd do this as I'd like to have a search fallback option that is 100% GitHub Pages compatible. Just to cover those who can't install Jekyll plugins or don't want to added complexity of using something like Travis CI to get around GH Pages 3rd party plugin limitations.

My other theme Minimal Mistakes recently added search support for Lunr.js, so I'm thinking that would be a good fallback. Just need to think about how I want the config setup to look like for the user.

The MM theme could also benefit from adding support for jekyll-algolia, especially since it's way more popular than this theme 😉.

I'll work on a proof of concept PR and ping you @pixelastic if I hit any issues.

@pixelastic
Copy link
Author

Awesome. I didn't check that MM had a search page already 🙄. That makes it an even better candidate.

Lunr would make a very good fallback for people that don't want to setup a Travis account for GitHub pages. It will be less efficient in terms of typo-tolerance and amount of data searchable, but will still give great results.

Let me know how if you have any questions and I'd be happy to help any way I can.

@mmistakes
Copy link
Owner

In progress #48

@mmistakes
Copy link
Owner

Merged in #48

@mmistakes
Copy link
Owner

Basically Basic demo site with Algolia search enabled - https://mmistakes.github.io/jekyll-theme-basically-basic-algolia-search/

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

No branches or pull requests

2 participants