In this blog post I go over which tools (libraries) I used to build my new website, what problems I ran into and which lessons I learned, preceded by a short history of my website. If you’re not interested in the short history, just skip ahead to the “Creating my new site” section.
A short history of my website
I acquired the bn2vs.com domain back in 2009. Before that I had some stuff on Geocities, and also had been running a PhpBB board for several gaming communities on another domain I owned. The first thing to go live on my new domain was a new PhpBB board in which I could put documentation for my software projects and let people comment. The root of the domain just redirected to this forum.
Soon after I created a blog and a wiki, and also wanted to link to various other locations on the web. The redirect from the domain root was replaced by a new page linking to my blog, forums, wiki, etc. Me being me, I just copied some HTML from my forums and modified it, rather than designing something myself. You can view the September 9th 2009 version on the WayBackMacine and compare it to the July 1st 2013 version.
Since I had grown unhappy with this page over the last two years or so, I decided to drop it and simply redirect it to my blog somewhere near August 2013. My main issues with the page where that it was hard to modify, and that it did not lend itself to have more elaborate content. Since I did not want to spend a lot of time on writing code for my website, I figured the easiest thing to do was just creating some pages on my WordPress blog. You can view the December 6th 2013 version. This redirect remained earlier this year when I launched the first version of my new website.
Creating my new site
For my new site, I had the following goals:
- Do not reply on overcomplicated frameworks and generally minimize code-wise dependencies
- Bind to as little infrastructure (ie databases) as possible
- Be able to have content in a simple format such as Markdown, while retaining the possibility to use HTML
- Do not spend time on coding up my own solutions which would then need to be maintained
- Have the content in decent version control, ie git
The earlier mentioned wiki has been down for about two years now, as I’m simply too lazy to maintain the thing. After all, why should have I to do all that hassle just to have half a dozen static content pages be displayed? A simple website can solve this.
Some time ago, at Wikimedia Germany, we (mostly Jakob) created a website for the Wikibase software we are developing. We decided to use Sculpin, a static site generator written in PHP, and to put the code on our GitHub. Since this approach satisfied the above conditions, I decided to try it out for my site as well.
New site v2
While Sculpin worked fine, I decided that I wanted some dynamic features as well. For instance, I wanted to be able to show a list of the most recent posts on my blog, or even embed them. I switched from Sculpin to the Silex PHP microframework, with which I have quite some good experience by now. It allow me to specify some simple routes to html files, and can do templating via Twig. Adding support for Markdown was easy using the Twig Markdown plugin and PHP Markdown library. For listing and embedding the latest blog posts, I figured that consuming my own RSS feed would be nice coupling wise. Implementation of this was also easy using the SimplePie PHP library.
Current status: new site v3
Today I made another set of changes. Most notably I moved my site and blog to a new VPS and got a new domain name: EntropyWins.wtf. Presumably this one is more memorable than bn2vs. In any case, it’s most certainly more in line with my current online alias than bn2vs and it’s original form [RTS]BN+VS*, both of which I’m rarely using anymore. The old domain will continue to work, and now redirects to the new one.
The new VPS I got is somewhat faster than the old one, and it comes with a more recent version of PHP. Both these should contribute to my site and blog being somewhat faster.
Another change made today is the addition of HTTPS support. I got a certificate via LetsEncrypt, a great service which is current in open beta. When hitting a HTTP URL you will be automatically redirected to the HTTPS equivalent. And according to SSL Labs, the certificate is grade A.
I’ve made a number of cosmetic changes to both my site and blog as well. My plans now are to do some layout work on the site itself, so it is more consistent with the look and feel of my blog. (Edit: as you can see, this is now mostly done. Some style issues remain to be fixed though.) Another thing I ought to get to is fishing my old wiki pages out of limbo and adding them to this new site.
If you’re curious about the code that runs this site, have a look at the GitHub repository. Beware though, that the Silex routing code is a bit off a mess at present. Back when I wrote it I was not so familiar with Silex, and I’ve yet to do a second pass on it.