How I made this blog and the technology choices that went into it

So I made a blog

If we all think back to our favorite technology blog, we'll usually see a post near the beginning about how it was made. Usually this covers things like technology choices, reasoning, and maybe even some coupon codes for hosting services.

This blog will be no different. I'll cover what technologies went into this blog and some of the motivations. I will leave it up to the reader to find out how, as often that's the best way to learn. If you have questions, though, you can definitely reach out and ask!

Static Site vs Web App

I've made a lot of web applications in my time. Many of them have been for my employers, and a few have been for me. Web applications provide a lot of flexibility and fun, and writing them can be a relaxing experience. While they are ultra flexible, there are just some things web applications shouldn't be used for.

If you have a simple page that doesn't need to consult a database or external data source, an option would be a static site. A static site is a site is one where the same page is loaded every time. There isn't any server side processing. Its a flat file that's handed across https and straight to your browser.

Static site generators are libraries/programs that take information, in this case markdown files containing blog content and page layout information, and converts it into those static html files that are served to your browser.

For this site, this is a place to put my musings. To tell the world what I'm up to, and show people some of the work I've accomplished. For friends, its a way to keep up with me and my family without having to lurk on social media platforms like Facebook.

This is the perfect use case for a static site and a static site generator.

No CMS?

Those who've been in the business long enough may be asking "Why not use something like WordPress or SquareSpace? You can do the same kind of thing there as well, and probably get it hosted." You are 100% correct. This kind of site is often provided via a CMS like WordPress.

WordPress is great for people that want to put a site together, get it working and get it out there. It's fantastic for people who want that but don't know how to edit code.

For me, I knew code, and I wanted a tool that I had 100% control over. That's why I chose a static site. I'm in VSCode all day anyway, so why not just compose my thoughts in here as well, hit a button, and have a new post out on the interwebs. Plus, I could house it in git, and have github automatically build and load my static site for all to see.

Which Static Site Generator

Now that I chose a static site over a CMS or web app, which generator should I choose?

This is not a hot topic of discussion, surprisingly. While some still argue, the king of static site generators is jekyll. It is the most well known static site generator out there. Even Github pages leverages jekyll, which happened because of the popularity of the technology, and has only helped bolster the ranks of jekyll aficionados out there. It is extremely flexible, and can do some pretty amazing things.

The biggest downside, for me specifically, is that its written in Ruby. I don't hate Ruby, but I'm not the biggest fan. I'm a Python guy at heart, and have been using python for well over a decade at this point. So, I wanted a tool that if I had to extend or reach into, I could. This is a passion project, and the more time I am actually writing content, instead of learning how to rewrite the generator, the better.

A quick google search lead me to Pelican. I'll be honest, my first blush with Pelican wasn't the best. Even though I skimmed the documentation, it didn't come super easy (this is because I should have read the docs instead of just skimming). Finding a theme took a bit, etc etc. I often do this kind of technological fun in the evenings, enjoying a cigar and bourbon on my back porch. So, in the span of 4 hours, 3 bourbons, and 2 cigars, I was able to go from an empty directory to fully fledged site with a theme.

Choosing the right theme took a bit longer. Of course, I had to make my own edits to it to make it right for me.

All in all, its a good static site generator, and I would recommend to a friend. So, Andrew, my friend, this is a good one to use.

Infrastructure

Now that I had a site, a theme, and a way to turn that sweet sweet markdown into html, I needed a place to put it so people can see it. A lot of places came to mind. There are tons of low cost hosting solutions all around the world, and many of them are absolutely great, especially for small sites like this.

That being said, the job market out there calls for cloud, and if you haven't been able to play in it, its a lot of fun. For an old Unix guy like me, being able to spin up an environment lightning fast that lives outside of my home network is pretty magical. Partially because it works... it just works. No hunting down endless errors until it works, nope, just functions right the first time.

I knew I wanted to host it using a cloud provider. I have the most experience with AWS, and already had an AWS account active, so I went there.

Here's what what the architecture looks like.

AWS Layout for scselvy.com

This site is hosted on S3, and cached by Cloudfront. The DNS is provided by Route53. This is the most basic form of secure site hosting. Its a static site that's cached in its entirety in cloudfront, which means you get it fast. How much do I pay? I'll follow up with you on that, as this blog was written before that first monthly bill. Currently, the plan is about $2/month.

The S3 bucket is much much less than 1GB, and the traffic is fairly low (at least until you tell your friends about it). Those are some of the big controlling factors of price in something like this. I also registered my domain with AWS (well, I paid AWS, they went to a third party to actually register and purchase the site). That costs a whopping $0.50/month by itself.

All in all, its a pretty slim/inexpensive way to share my thoughts with the world. In follow up posts about this, I'll talk about the continuous integration I have setup, and some of the challenges I faced there. Basically, I want to push my changes up to github, and let AWS take on the rest.

Since I'm running AWS heavy, that will mean using AWS Codepipeline. This is Amazon's answer to things like Jenkins or CircleCI/AgroCD.

I'll also host a tutorial about some of this at some point too!

Oh, and for the coupon codes... I don't have one, but AWS is pretty cost effective. There's a lot of great resources, check it out if you can.