A very simple html template for you
<body>
<template id="my-template">
<div>{{myVariable}}</div>
</template>
</body>
<script type="module">
import Ibh from 'https://cdn.jsdelivr.net/gh/csakaszamok/ibh/dist/ibh-0.1.0.min.js';
const elem1 = Ibh.cloneTemplate({selector: '#my-template', variables: { myVariable: "What's up ?" } })
document.appendChild(elem1)
</script>
Output:
What's up ?
<body>
<template id="my-template">
<div>{{myVariable}}</div>
</template>
</body>
<script type="module">
import Ibh from 'https://cdn.jsdelivr.net/gh/csakaszamok/ibh/dist/ibh-0.1.0.min.js';
const arr = [ {myVariable: 'This is one'}, {myVariable: 'This is two'} ]
const selector = '#my-template'
arr.map( item => document.appendChild( Ibh.cloneTemplate({selector, variables: item }) )
</script>
Output:
This is one
This is two