Host a Static Site on Netlify in 0 Minutes
I am amazed at how easy it is to host a static site on Netlify.
It's coming up on that time of year when one page on gun8 about why your Christmas LEDs flicker becomes popular, so I wanted to get the site switched to some kind of static site hosting to easily handle the incoming traffic. After fighting with various options and nearing the point of tearing my hair out, I looked at Netlify again and found a simple solution.
The code that runs gun8 is relatively simple (compiling Markdown files to HTML, with no database), but it's also custom built, which is fun to tinker with, but hinders its compatibility. My language of choice is Ruby, which immediately leads to Jekyll as a static site builder, but Jek's stubborn unwillingness to work with Haml and my inability to make it even apply a layout to a page made me frustrated and hesitant to convert my site to match its hard-coded expectations.
The frustrating aspect of any static site is trying to get pretty URLs that don't end in .html. That's a complicated endeavor on S3 or Github Pages, but it's easy to solve on Netlify by… clicking the "pretty URLs" button 😁. Add -E to your wget to give your static files an .html extension and wham-o you have pretty URLs without any weird renamed directories and hundreds of "index.html" files.
Netlify magically rewrites all URLs sitewide to correctly point to the right location (unlike Cloudfront's mirroring setup) and navigates redirecting ending-slash-or-no-slash to make one canonical URL for each pretty URL'd page, two benefits that I am more than happy to outsource to someone else's mind ☺️.
Make a change
Deploying and updating are as simple as dragging the static site folder into your Netlify admin area. I've tested out a few simple changes and they propagate faster than when I've used Amazon S3/Cloudfront or Github Pages. Plus it's extremely satisfying to feel like Netlify is working with you instead of against you. I've been programming Ruby for more than a decade and it's downright demoralizing to fight with Ruby-based Jekyll only to end up with unstyled page fragments. Netlify provides thought-out solutions instead of dead ends. Compiling locally means that the extra processing steps I would have been giving up to run Jekyll (like adding Twitter meta tags) can be easily solved however I want locally before the HTML is uploaded.
The site still goes through Cloudflare, and gun8 was basically a static site before, so any actual speed increase after switching to Netlify would be difficult to notice.
Thankfully there are sites like Neocities that still allow emerging web devs to play with HTML, and anyone could silo their writing away into Medium.com or Telegram's Telegra.ph or shudder as a Facebook post.
or just bring back Scribble.nu, where I got my start writing poetry sometime around 2001 😛