This is the first post of the Silver Fox blog, a place where I will share interesting findings, new projects and just random thoughts. Kinda like my Twitter feed, but without a character limit.
My name is Louis D'hauwe, I'm a Belgian programmer born in the late nineties. I currently work as a full time iOS developer at Next Apps. My full time job plus my side projects can easily add up to about 50 to 60 hours a week of writing or reading code. As of late, most of this code is Swift (though not all!). It'll be of no suprise that most posts will be about some code.
Starting a blog in 2017
For a couple of years now I've been thinking about starting a blog. Starting one is pretty easy nowadays. Medium, Squarespace and others can get you started in a matter of minutes. However, for my blog I wanted a little more control.
I decided that all I really need is static webpages. I don't need a comment section, or some admin panel to write posts. But obviously writing blogposts in HTML directly is tedious, there's need for an abstraction. The ideal candidate (from a software developer's perspective) is Markdown.
Each post (including this one) is written in a Markdown file. These are converted to static HTML pages by a Swift command line tool that I wrote myself.
I have open sourced four projects that together make this whole site possible:
- silverfox-articles – the blog posts (.md files)
- silverfox-news – news items about my projects (.md files)
- silverfox-gen – generator for the static content
This is perhaps the most interesting of the four. This is a Swift command line tool that takes its input from silverfox-articles and silverfox-news. It outputs the result to silverfox-site.
There are five main aspects to silverfox-gen:
2. Markdown support
3. Syntax highlighting
4. Dependency manager
silverfox-gen was developed to run on macOS. This gave me the opportunity to use the Swift Package Manager. The biggest advantage of this is that it's included in Xcode. So there's no need to install a command line tool.
This blog supports RSS, which requires an xml file to be generated with all the posts. Luckily, Foundation on macOS includes XMLDocument. Using this, I was able to write an RSS feed generator in about 30 minutes.
An excerpt of the generation code using the Files framework:
let rssFile = try outputRoot.file(atPath: "silverfox-rss.xml") try? rssFile.delete() let rssString = generateRSS(for: articles) try rssFile.write(string: rssString)
If you would like to get notified about new posts, you can: