3 hours ago · Tech · 0 comments

Andreas blogged about adding the bubbles.town widget to his blog. He used the vote widget provided by bubbles.town, which is just a bit of JavaScript you put on your pages. It's well documented and dead simple, so if you just want this on your site with no fuss, that's the way to go. I use 11ty as my blogging platform and I could just use the same JavaScript snippet on my site but I wanted to make something that's a bit more in the spirit of a static site. It's a tiny script, so yeah, I'm being a bit of a purist about it. But I like keeping my pages free of other people's JavaScript and the third-party requests that come along with it. Plus, I wanted to style the widget a bit differently than their widget does. Here is how I did that. What the widget actually does # First I poked at what the widget actually does. I'm no JavaScript wizard, but it didn't take much. When the page loads, the script calls a small API on bubbles.town, GET /api/vote-count?url=..., gets back the vote count…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.