Goodbye Ghost, Hello Wyam

Published on Sunday, May 21, 2017

Goodbye Ghost, Hello Wyam

So it seems as if no matter how committed I am, blogging is just one of those things that unfortunately always gets bumped to the bottom the priority list and utlimately never happens. Because of this, it became difficult for me to justify spending ~$50/mo ($600/yr) running Ghost Blog on Azure and therefore I began searching for lower cost alternatives.

Criteria

During my search, I used the following criteria (in no particular order):

  1. Azure - Since I know and love Azure, I wanted to continue leveraging it as my hosting platfrom.
  2. Markdown - This was one of the things that originally attractd me to Ghost and something I fell in love with. Markdown really is a glorious language for authoring content.
  3. Drafts/Revisions - I wanted the ability to maintain mulitple drafts and keep track of revisions.
  4. UX - The blog has to look good and also be performant.
  5. Easily Customizable - The blog had to be easily customizable without the need to drudge through the typical CMS/blog cruft. I also prefer a solution that uses C#/Razor since I really enjoy working in those languages.

The Framework

After a couple evenings of searching, I happened upon Wyam and immediately knew it had promise. TL;DR - Wyam is a static content generator that has many different "recipes" that can injest markdown and spit out blogs, documentation sites, book sites, etc consisting of static HTML files. I recommend you take a look at the Wyan site for more info.

Hosting

Now that I had a potential framework/platform with which I could generate my blog, I began shifting my efforts to think through Azure hosting options that would allow me to minimize costs. Since Wyam generates nothing but a collection of static files, Azure CDN jumped out at me since as the natural fit. The only thing I needed to figure out was how to make extentionless URLs work AND force SSL. I sunk many late nights into figuring out the secret sauce using custom Azure CDN rules... I plan on following this post up with a HOW TO so you can replicate this solution if you'd like.

Building

Finally, I needed to to get the the markdown from my machine, built into static html, and then into Azure Blob storage to be served from Azure CDN. Well it turns out VSTS and continuous integration builds could do exactly that. Using VSTS for source control would also check the box of allowing me to create multiple posts (branches) and track revisions (commits). Again, I'll include all this in my forthcoming HOW TO.

Trade Offs

The concept laid out above is great for a very simplistic blog like mine; however, it's not perfect. Far from it actually.

For starters, I can't currently schedule blog posts to go live - as soon as the post is merged into master, the CI build will be triggered, and a couple minutes later the post will be live. I have an idea of how I can potentially work around this, but I'm going to need to prototype it out to verify.

Another tradeoff is that I lose the ability to robustly handle 404's and other HTTP errors. Additionally, you can get to pages/posts using URLs with and without extensions. As an example, my original post:

Finally, since the pages are all static, I don't have server-side processing capabilities to handle forms or anything of that nature. I may be able to utilize Azure Functions for something along those lines, but I'll cross that bridge when I get there.

These are all tradeoffs I'm willing to make because I estimate my monthly blog bill will drop from $~50 to < $2. Yes, Blob and CDN are CHEAP!

That's it for now. Stay tuned for a follow-up with the step-by-step of how to do all this.

Cheers, Ryan