Liquid template
Render function
import { fromLiquidTemplate } from "@nosto/autocomplete/liquid";
const render = fromLiquidTemplate(`
<div>
<h1>{{title}}</h1>
<ul>
{% for product in products %}
<li>{{product.name}}</li>
{% endfor %}
</ul>
</div>
`);
render(document.getElementById("container"), {
title: "My Title",
products: [
{ name: "Product 1" },
{ name: "Product 2" },
{ name: "Product 3" }
]
});
Render a liquid template into a container