Is it possible integrating "Mustache templating by Hogan.js"

Mustache templating by Hogan.js is used by Algolia Instant Search amazing example here.

While I’ve already being able to integrate many other examples in my Hogo sites (see one of them online), this seems to have some JS issues related to Hogan.js

Does anybody tried to integrate HoganJS or even better the full instant-search-demo code, into Hugo ?

1 Like

So looking at this part of your example:

I don’t know why you couldn’t necessarily do this with Hugo, although Golang templating is very sensitive to context, so putting your templating between <script> tags can get tricky. (Just search for this across these forums; it’s mentioned in a whole slew of places.) That said, this is an example page with what appear to be a limited number of records.

HUGO does recognize .json as a mime type, so there is no reason you can’t create an index of all your products with Hugo’s templating with your own scripting to create the kind of records that are easily digestible by Algolia. Since this is really a JS-based question, the Hogan part of the templating is really a separate concern from Hugo’s templating, and—as mentioned above—remember the context sensitivity. The double curlies have also been mentioned in another thread, which might provide some insight. I don’t know Hogan well enough to mention anything about custom delimiters a la mustache, et al: