I’m a huge fan of static generated websites! From a personal level, I have The Polyglot Developer, Poké Trainer Nic, and The Tracy Developer Meetup, all three of which are static generated websites built with either Hugo or Eleventy. In addition to being static generated, all three are hosted on Netlify.
I didn’t start with a static generator though. I started on WordPress, so when I made the switch to static HTML, I got a lot of benefits, but I ended up with one big loss. The comments of my site, which were once stored in a database and loaded on-demand, didn’t have a home.
Fast forward to now, we have options!
In this tutorial, we’re going to look at maintaining a static generated website on Netlify with Eleventy, but the big thing here is that we’re going to see how to have comments for each of our blog pages.
Read MoreA few months ago you might remember a tutorial I put out regarding remote caching in Eleventy. In this tutorial titled, Download and Cache YouTube Data in an Eleventy Website with Simple JavaScript, I demonstrated how I was automatically gathering YouTube videos from a playlist on my Poké Trainer Nic channel and publishing them to my Eleventy website.
At the time, this was the best thing since sliced bread for that particular website. Fast forward to now and we’ve got a problem with too many videos loading all at once with a ten hour scroll to reach the bottom. The scroll time is an over exaggeration, but you get the idea that too much content on a single page can become a problem.
This lead me to pagination and showing only a small subset of videos per page.
We’re going to see how to very quickly add pagination to an Eleventy website, something that can be accomplished with a few lines of HTML and a few minutes of your time.
Read MoreSo you want to add your YouTube videos to your static generated website, but you don’t want to manually keep track of all your videos and playlists? I get it because I’ve been there!
Take my website, Poké Trainer Nic, for example. It’s a Pokémon website built with Eleventy that shows a list of my YouTube videos among other things. The videos on the website refresh daily, but it’s not something I do manually.
So how do I do this?
In this tutorial you’ll see how to get information about your YouTube videos and playlists using APIs for displaying within an Eleventy website. To make things better, we’re going to see how to cache this data to prevent making too many requests to an API that has a finite allocation.
Read More