Making a Shuffle Button 1 ▲ Jim Nielsen 11 hours ago · 5 min read1089 words · Tech · hide · 0 comments I made some updates to my notes blog, including a change to how my “Shuffle” feature worked. Figured I’d blog about it. Shuffle? On a Blog? At the time of this writing, I have 974 “notes” that I’ve published. For fun, I have a “shuffle” button that digs up a random note from the past. I like to press it from time to time and re-encounter some insight from the past. It’s like going through an old album, pulling out a random photo, and thinking, “Oh yeah, I remember this! Good times.” Like old photos, there’s also the occasional “that didn’t age so well”. But I find it fun to randomly dig up old insights from others and continue to be inspired. How Did It Work Before? Since my site is built and hosted as static files without a runtime server, this feature required JavaScript to work. Every page had a snippet like this: <!-- In the site navigation --> <button id="js-shuffle">Shuffle</button> <!-- Way down at the end of the HTML --> <script> // All 974 note IDs injected by my SSG const… No comments yet. Log in to reply on the Fediverse. Comments will appear here.