Hello, World!

dl on Sep 3, 2021

Hello and welcome to the humble SwiftySites Blog. As a first post I thought it would be nice to share some of my motivation for building this library.

Nowadays it's pretty common for a programmer to want to show their work and process to the world. It's also common for us to write our own tools.

In the past I had used everything from traditional content management systems to popular publishing platforms. For the past few years I settled for the awesome Hugo static site generator which I used to build the original Swift You and I publication.

Hugo has a lot of amazing features which I love but it dows require some knowledge of the Go Language for writing the more advanced templates. For a long time I tried my best to learn but never felt as at home as I do when I write Swift.

Looking for options I quiclky landed in John Sundell's tool Publish. To be perfectly honest this would have been the tool to choose from the beginnig – had it existed a couple of years back.

At this point I had gotten accustomed to many of the niceties of Hugo and wanted to keep some of them around. John's DSL approach showed me that the Swift compiler can really be helpful when defining a website's structure so I came up with a hybrid concept.

Instead of declaring everything straight in Swift I decided to split the problem in two. For the content's metadata – which Hugo implements with Front Matter – I would leverage the full power of Swift's type system. For the templates I thought of something else…

Swift already has a great templating solution called string interpolation. This was the last piece of the puzzle. From the first proof of concept I noticed how nicely the structured metadata merged with the more free string composition.

In the coming weeks I will use this very site to test the concept and document the process of building a framework that hopefully other people find useful.