Creating Websites with Wyam

Creating Websites with Wyam, an extensible static content generator for .NET.

Published on January 2, 2018

When it came time to rewrite my old website I knew I wanted the flexibility and control of writing a website from scratch but was hesitant to write my own content management system. Thankfully, I discovered Wyam which is a modular and highly configurable static content generator for .NET. Static content generators take a collection of input files such as layouts, posts, and images, and generate a static website. There is no need to maintain databases, storage, or servers. One huge advantage of this approach is that pages can load remarkably faster since pages themselves can be cached on a content delivery network.

Wyam in Visual Studio Code

Wyam allows you to create layout files with Razor just like you would with ASP.NET. It also allows you to write pipeline modules in C# or any other .NET language if you need greater control over how the content is generated. Posts and other pages can be written in Markdown or Razor and can have attributes such as publication date or related image defined with YAML at the top of the file. Wyam offers a few recipes out of the box such as one for a blog and another for docs but can be used for much more due to its extensibility and flexibility.

You can setup continuous integration with Wyam so your site is automatically rebuilt and deployed every time you push a change through Git. This site was made with Wyam and so far I am extremely pleased with the authoring experience and the astonishing performance.