kakawait / hugo-tranquilpeak-theme

A gorgeous responsive theme for Hugo blog framework
https://tranquilpeak.kakawait.com
GNU General Public License v3.0
922 stars 527 forks source link

Algolia support #8

Open kakawait opened 7 years ago

kakawait commented 7 years ago

Invest new feature from Hugo 0.20 http://gohugo.io/extras/output-formats/

willwade commented 7 years ago

We have recently got this working in our fork with a npm script:

see https://github.com/openassistive/hugo-tranquilpeak-theme/commit/525a0dc0ceccdc3796ebd57c3ca5e8e89ddaaec0

and https://github.com/openassistive/OpenATFrontEnd/commit/801776c5dd617da7931e716f5116adf5971beaf9

and to see it in practice: https://openassistive.org (click on search in nav).

We run it with npm run reindex || true && hugo to build the site

ghost commented 7 years ago

https://www.algolia.com/pricing is a freemium tiered product. For those looking for search without paying for a product search can be added and scaled for free using open source tools such as Bloodhound by Twitter (or its logical successor) and https://www.lunrjs.com/.

If this were an e-commerce theme (which it's not), I would say the same thing.

ghost commented 7 years ago

https://gist.github.com/sebz/efddfc8fdcb6b480f567

hugo + gruntjs + lunrjs = <3 search

willwade commented 7 years ago

Two problems I see with this:

  1. The upstream project is using algolia and I know @kakawait wants to stick as closely as possible to that. Using a different JS library changes the project quite a bit
  2. If you have a lot of data - using Lunr isn't a great idea.
ghost commented 7 years ago

Thanks for the info @willwade. Didn't realize the upstream was using Algolia. That's a shame IMO, as it leads individuals to rely on third parties when OSS can get them there free (one way or another), stymieing innovation as a result.

Regarding your second item, anyone having enough data to require something beyond Lunr probably isn't using this theme.

willwade commented 7 years ago

I agree on that @jhabdas 👍 - they probably aren't.. although we are (it may not be for long to be honest..).

(Thanks for that gist by the way - I do love Lunr. I don't see a major problem by the way supporting it as well as algolia. do a fork ;) )

kakawait commented 7 years ago

About upstream project, I'm not open to add more feature on that theme that may not exist on upstream project, but I'm trying to report at least everything feature (that seems relevant) from upstream project. That why Algolia support is tracked.

I'm sure Lunr I will check it but after Algolia, I can't work on both in same time (not enough time).

@willwade Thank for link I will check that. But as I said there is also new feature from Hugo 0.20 that should help.

ghost commented 7 years ago

But as I said there is also new feature from Hugo 0.20 that should help.

And here it is: https://gohugo.io/content/types/