Fork me on GitHub

My adventures with Ghost blogging platform

TLDR:

Just want to create a standard blog to Ghost.org using standard themes and start blogging?
Yes, the system is definitely ready for that.

Wan’t to use it as you usually use WordPress?

Status: medium-raw, with some blood involved. But definitely possible. And it’s getting better day-by-day. This post is exactly about that topic.

The story
So some time ago I was asked to build a WordPress site. I’ve built a lot of those in the past and I’ve also used a lot of Drupal in the past. The only thing is that for the past year I’ve only used NodeJS for my things and I don’t miss PHP at all.

The first rationale for me is actually the design. When in PHP (which always closes the connection after the page is loaded) every click generally means the whole page gets refreshed, then Javascript does not make such limitations. And that somehow frees a lot of template-minded thinking from my head.

The other thing is that being able to use the same Javascript in both front end and backend sorta makes the development process easier. Hey – it makes you a full-stack developer with only one programming language.

So anyway – I pitched to the client that we should try Ghost instead. They were rather doubting but if I explained that the the project got started when the UI team manager from WordPress decided to create a new blogging platform the “from WordPress” part seemed to calm them down.

I was also a bit scared, but from the other hand I was really curious about the early ecosystem of an open-source software.

The process
Creating a new theme is already pretty straightforward. I learned the whole templating system (I also created a blank theme/cheat sheet for Ghost called Transparent). After that attaching the initial frontend to a new theme went really fast and easy.

The first bump on the road was finding a place where to host the site. You see – something that is not based on PHP & MySql might not work with your local hosting provider by default. Unless you wan’t start installing Linux over the command line yourself.

I’ve been using a lot of Heroku lately but apparently you cannot run Ghost on Heroku. First of all the SqLite, which Ghost uses by default saves data as files on a disk, but Heroku looses all the files you do not have in git at least once every 24 hours (it called a ephemeral filesystem). You can use MySql instead of SqLite, but you will still not be able to upload images to the posts. Or you are able to upload them, but they will be gone tomorrow.

I tried out OpenShift, there were some occasions I got the whole thing working but generally I still found OpenShift to be a bit bulky for my taste.

Now it’s a good moment to talk about the community. Ghost has a pretty active community, new updates and feedback to the Github repository being added every day. There is also a forum, google group and IRC chat. I found the IRC chat being most helpful. I got a _lot_ of help from there while building the site. Thank you, again Ghost community!

The IRC chat was also the place where they told me that most probably the best current place for hosting would be Ghost.org. On my quest I also saw some other cool places that provide Ghost hosting, but wanting to support the creators I decided to suggest ghost.org to the client.

Nevertheless – hosting the site at Ghost.org also had some negative influences to the project.

Our domain was already registered at a local domain register / hosting provider, but during the project it turned out that we also need to get about 50 e-mail addresses (which is a normal request, right?). But – e-mail service you usually get in this parts of the world together with the website hosting. So that meant double hosting expenses for our client. This situation actually hasn’t resolved as I’m writing this.

Also directing the domain proved to be a challenge – directing the www.domain.com was easy, but directing the domain.com part created several grey hairs for me (you cannot just do a A/AAAA IP forwarding since Ghost.org blogs don’t give out IP addresses & our domain registrar only supported the IP forwarding). I ended up using something called CloudFlare, which was a new thing to me. But the good news – I finally got the without www redirection working!

The hacks
Since the project started as a normal website, but ended up a bit bigger I had to find quite a lot of hacks to usually easy solutions. One thing that the client did not know in the beginning (when I pitched Ghost) was, that it’s going to be a multi-language site. That’s not a big issue, but since the API (one of the things I look forward a lot) is not public yet then I had to hardcode the menu. I also used an iframe (yes you read that right) to show posts in the front page of the other language site (since posts object is only passed to index and tag templates).

I also ended up putting a registration form to Heroku since it… well it was much easier.
Workflow
As I’m writing this I’m narrowing down to the most difficult part of the process, which is a the workflow (with ghost.org). As is normal, the client had several (to be honest – more than usual) requests to make little edits and updates to the project.

Here I want to thank again the Ghost community who helped to make the update process easier for me. I’m presenting the easier process:

1. Make changes in localhost.
2. Run “zip -9 -r –exclude=*node_modules/* –exclude=*.git* spin.zip spin”
(spin being the name of the theme and this command excluding the non-necessary parts of the theme from the zip file <- this I got from the community)
3. drag’n'drop the zip file to the self-service in browser.
4. Click Save.
5. Pray it works (if not you have repeat this process)

I know these 5 steps don’t take long, but I haven’t used such a long process for updating for years to be honest.

The hardest part was making updates after the domain redirection was done. After fixing a little issue in design for a couple of hours I finally cracked the nut – Cloudflare creates cashing and I had to turn that off in order to see the changes. Did not see that coming.

What the client thought
The client was at times confused, but generally it went even easier than expected. The first thing I heard was “wow this is the most minimal backend I’ve ever seen” and the second thing which was also unexpected was that using markdown was ok for them. And it was ok up to the point where instead of pushing the good old “insert image” picture the client would have to write “![]” and then a wild image upload would appear. To make it a featured image in the index site the image would have to be the first thing in the post. Put that was OK. Which is nice! Which is why I like Ghost.

What to learn?
It is possible to use Ghost already for a website+blog setting, but I’d wait just a bit more. A lot of the stuff you might need might just be in the state of “wait just a couple of more months”.

Also – your adventure may vary a lot depending on the hosting provider you choose.

Nevertheless if you know the limitations you can do simple stuff already today.
Just make sure the first project will be an easy one.