Setting up my first blog

Published on 06 August 2017

Why

Lately I have been realising that I would like to create a blog. The main reason for this is that I keep coming into contact with more and more new technologies, and as a professional "hobbyist" I do like to read up on every bit of technology that I can get my hands on.

The downside of this is that since I don't take proper notes, I have to refresh my knowledge with blog posts, docs, etc. So I thought I'd use this blog as my personal notepad, and this also gives me an excuse to experiment and talk about even more new things! Let's hope I keep this project up :)

To create my blog I wanted to use a static site generator instead of using a dynamic site, because I have not built a website with this type of technology! What better way to get used to how something new works then to build something with it? Since I know my way around .NET, I decided to go with Wyam since that was the first result in google, as well that it had tests, and it looked like it was well thought out.

Wyam

I went with using Chocolatey to install Wyam:

choco install Wyam -s https://www.nuget.org/api/v2/

Then to setup Wyam with the blog template:

Warning: this creates a blog in the current folder, so make sure that you are in an empty folder

wyam new -r Blog 

When you are getting started with Wyam I recommend using the watch and preview functionality by running wyam --watch --preview from the directory in which the site resides. what this will do, is that it starts a local server on http://localhost:5080 that will auto-refresh your browser when you make any changes.

Another useful resource is the list of sites built with Wyam, these can be found here: Built With Wyam. I definitely used this a lot as a reference, together with the Blog Recipe documentation.

I started with modifying config.wyam to make it use the CleanBlog theme, and configured some of the Blog Settings to make the blog look a bit more customised.

My complete config.wyam now looks like this:

#recipe Blog
#theme CleanBlog

Settings[Keys.Host] = "www.jark.io";
Settings[BlogKeys.Title] = "Jark's blog"; // is displayed on the top-left
Settings[BlogKeys.Description] = "Jark's blog"; // is displayed as the main title on the index page
Settings[BlogKeys.Intro] = ".NET Developer, hobbyist"; // is displayed below the main title
Settings[BlogKeys.CaseInsensitiveTags] = true;
Settings[BlogKeys.IgnoreFolders] = "drafts"; // gives me the ability to upload ideas for articles without them appearing in the generated site!
Settings[BlogKeys.Image] = "/assets/images/header.png"; // custom header image with absolute path otherwise this will look bad on pages / posts

I also wanted to set up a way for people to leave comments, mainly because I firmly believe that sharing knowledge is important and that you can't share knowledge one way.

On the Wyam site they mention using Disqus, I haven't heard anything bad about it and the management tools behind the scenes look powerful enough so I decided to use Disqus for this blog.

I set this up by using the method outlined above, using the _PostFooter.cshtml, this file is loaded in after every post.

Lastly I setup google analytics by creating a _Scripts.html page, this is then loaded in for every page on the site.

After I verified that everything looks like the way I want it to, I generated the site using wyam build. The static site is now ready to go!

Hosting & deployment

With the hosting, I went for [linode] (https://www.linode.com/?r=c463f537620e9dda7180625b06ee9e41060d09c4), I got $20 worth of free credit, and I put $20 in myself. This should cover the hosting for my blog for the next 8 months. Not too bad I'm thinking. After the 8 months are up I'll decide if I'll stay with Linode or if I'm going towards some other solution sp I can try out a different stack.

Right now my whole deploy process is done manually, but this will change in the future and I will write a post about that process as well.

Thanks for reading my first post, and I promise there will be at least one more post, so look forward to that!