I’m trying to integrate an Angolia instant search page into a Hugo site. Angolia code uses {{braces format}} so how do I retain this in my outputted HTML?
Thanks for the reply @jetwash. I had tried safeHTML and it outputs an odd result for me. It outputs the second safeHTML value as desired but not the first safeHTML value. This is what I see in the source code after Hugo build…
@budparr you’re a genius! That is super helpful. And thanks for helping out in Hugoland like you do too.
It’s taken me some time to get Algolia working locally — since my last post in this forum infact! I’ve used the Algolia “Index Simplified” example and hacked it to suit my data and HTML. So the HTML block is reasonably sized and certainly beyond me to turn into a JS file. Is there any other way to import it? As raw HTML somehow?
<script type="text/html" id="hit-template">
<div class="hit">
<div class="description body-text hit-content">
<h1 class="heading hit-name">{{{_highlightResult.name.value}}}</h1>
<div class="header-description">
<p class="uppercase">
<strong>
<span class="hit-country uppercase">{{{_highlightResult.country.value}}}</span>, <span class="hit-state">{{{_highlightResult.state.value}}}</span>
</strong>
</p>
<p class="hit-location"><strong>
<span class="hit-location">{{location}}</span>,
<span class="hit-suburb">{{{_highlightResult.suburb.value}}}</span>,
<span class="hit-postcode">{{{_highlightResult.postcode.value}}}</span>.
Time: <span class="hit-time">{{time}}</span></strong></p>
<p class="">{{description}}</p>
<p><a class="hit-url" href="{{url}}" target="_blank">More details about this event →</a></p>
</div>
</div>
<br><hr><br>
</div>
</script>
<script type="text/html" id="no-results-template">
<div id="no-results-message">
<p>There are no <em>"{{query}}"</em> events yet.<br>
More events are being added so check again soon.</p>
<a href="." class='clear-all'>Clear search</a>
</div>
</script>