Hello Sandra Snow

As the hawk eyed of you will have noticed - my blog has changed somewhat recently. Not only has it had a total redesign but I've also switched the blogging engine from WordPress to Sandra.Snow. Sandra is a Jekyll inspired static html blogging engine written by Phillip Haydon and Jonathan Channon and is powered by the Nancy web framework.

The structure of a Snow blog is simple - a Razor site defines your template and static pages and posts are written in markdown. Snow.exe simply converts the markdown to html, compiles and renders the site as html and outputs it in your target folder. Simple. No database. No fancy dlls. Just html. Take a look at the sample site on GitHub to get a better idea of this. David Whitney has also created a sample template for use on Azure that contains the deployment files, compiler and output directory you will need.

From here on I will be taking Davids approach of adding Snow.exe into a _compiler subfolder and code samples will referring to my blog on GitHub.

Setting up Sandra locally

The first thing you should take a look at in the templates is snow.config which defines everything from where the posts are to the url format. The important thing for running this locallay is the output path as this is where the site will be deployed.

Living in the Visual Studio world it can be easy to get complacent about simply hitting hitting F5 and waiting for the browser to show. There are parts of this that I don't like, mainly the waiting, but I do like having a one click build. I'm using Sublime Text for editing this post so to keep my lovely one click build process I've added a custom build system:

{
    "cmd": "$project_path\\_compiler\\Snow.exe config=$project_path\\"
}

Note that this depends on the sublime project file being at the root of the site and the compiler being in the _compiler subfolder. With that lot set up it's Ctrl+B and hey presto the site is updated in the output folder so just point a local IIS website at it.

Building your own template

The templates are just Razor so @if and @for to your hearts content but take a look in the View Models to see what is available on each page. You'll also want to hop back into snow.config to define any additional pages or change the folder structure.

Deploying to Azure

This is so easy it's hardly worth me writing up. First create a new website on Azure. If you've already got your code on GitHub then just point the website to this, if not then add a private git repo like Phillip Haydon shows here. Providing you've used eiteir David or my repos as a template it will build and deploy. That's it. Now every time you commit to the branch you have synced with Azure your site will be updated. This seems very SDHP to me.