Goodbye Wordpress, Hello Ghost

As you might notice already, i run my blog with something different than Wordpress. Many years1 i've used Wordpress as logging CMS for my needs. In the meantime Wordpress has grown to full fledged CMS, but still has problems in terms of security, performance and ease of maintenance...

At some point i started a move to the cloud with everything i do in web, and i've learned to love microservices and Docker as tool for it. After all looking at Wordpress in 2015 it seemed not to be the tool of choice for simple private blog anymore...

Ghost platform

Looking for alternatives, there is one pure blogging solution which is Ghost. Meanwhile i've created Golden Docker image for Ghost and user it to run this blog.

UI Changes

Inspired by Peter2 i've took a decision to try default theme "Casper" of the blog. I've very satisfied with the adaptive design (Looks great on Tablet and Smartphone) by default. Also it has great typography, i don't have to tweak it. The template is very simple and understandable...
However some small issues are still present here so i will create my own fork of this template later.

Structural changes

I've also changed url structure of the post. Now its for /hello-ghost/ instead of /2015/12/hello-ghost/ for example.

Further more navigation via archive pages, tags pages and further cross-linking plugins is gone. And i've introduced manual (Yes, manual) year pages e.g 2015. Also there is no automatic tag page so i've collected most used tags to a separate page.

Configuration

I don't want to lose back links for articles after change of url pattern, so i need to redirect them.

nginx

Fortunately nginx is very powerful in such things. Here is map configuration that matches exactly the old pattern with yer and month. And the use of that map for the blog server, see:

http{

   #Matches old Wordpress links
   map $uri $redirect_topic {
     "~^/\d{4}/\d{2}/(?<topic>.*)" $topic;

  ...

   server{
    # Rewrite old style URLs (apply map)
    if ($redirect_topic) {
       return 301 $scheme://$host/$redirect_topic;
    }
    ...
  }

}

With that URL redirection is working i could start with ghost.

Docker-compose

And so easy it ir to start the blog with docker-compose.

ghost:  
  image: gold/ghost:0.7.3
  command: npm start --production
  restart: always  
  ports: 
   - "2368:2368"
  volumes:
   - /home/containerdata/ghost/alho/:/var/lib/ghost
  environment:
   - GHOST_URL=http://alexander.holbreich.org 

Syntax highlighting

Syntax highlighting is very important for every developer's blog. I'm using highlightjs.org which is quite easy to use and configure.
In my case i've included it to the theme

<!-- http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html -->  
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/styles/github.min.css">  
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>  
<script>hljs.initHighlightingOnLoad();</script>  

Later i will create my own fork of the theme.

Performance

But there is more. I've not only moved from Wordpress to Ghost but also i've changed my old hosting provider to Google cloud. That both facts result in better page loading performance. Here as you can see in google crawling statistics:

So from 2400 ms in spikes before and Ca. 200 ms now... Very very nice.

Enjoy!

  1. It must be something about 9 years, according to a publishing date of the first post

  2. Peter Timofejew's Blog was inspiration for many things with Docker and Ghost. He has a number of very practical articles regarding this topic.


Historical screenshots

I found some old screenshots of the blog.

And this is one from 2005 :)) Oh, no... ;)