Hello, World. I have started a new blog.

For this blog, I decided to go the static site route. I wanted the site to be lightweight, to be able to write posts in markdown and the pages to be written with a templating language.

Tech Stack

It had come down to Razor or Liquid for templating. Ultimately I decided to go with Razor because I wanted to have plenty of control with what I could do during the template compilation pass. I also wanted to limit the languages I was using and I was already writing the static site generator in C#. More on that next.

Static Generator

I wrote a simple command line tool in C# to facilitate creating posts and compiling the blog. It uses Razorlight for the templating part, and Markdig for markdown to html compilation. A single call from the command line and you get everything you see here.

Syntax Highlighting

For syntax highlighting I am using PrismJS. I would have liked to have this part statically generated as well, but I did not want to add an extra dependency to node to the build pipeline. Though I might see see if PrismJS works on QuickJS later. I am willing to make that concession s it would be a lightweight dependency.

In reality, the sole purpose of this section is to make sure that syntax highlighting is working correctly. Let's have a look:

C++

#include <stdio.h>

int main( int argc, const char* argv[] )
{
    printf( "Hello, World\n" );
    return 0;
}

C#

using System;

namespace MyApp
{
    class Program
    {
        static void Main( string[] args )
        {
            Console.WriteLine( "Hello, World" );
            Environment.Exit( 0 );
        }
    }
}

Javascript

function main( argv )
{
    console.log( 'Hello, World.' );
    return 0;
}

Typescript


type int = number;
function main( argv:string[] ):int
{
    console.log( 'Hello, World.' );
    return 0;
}