Your Glitch in Bio site is built using Vite, and uses Handlebars to build the JSON data into the page. The site comes with a custom helper called hostasclass
included by default but you can add more.
Let's try adding a silly helper function that returns emoji to the page. In vite.config.js
, after the hostasclass
helper, add this function (after a comma to mark the end of the previous one):
getemoji: num => {
let emoji = ["🚀", "😺", "⚽", "🎈", "🎉"];
return emoji
.slice(0, num < emoji.length ? num : emoji.length).join("");
}
Now to use the function in the site, in links.html
add this after the closing </li>
tag: {{getemoji 3}}
You'll see the emoji written into the page under each link in the preview.
Try changing the functionality or adding your own helper!