So I figured I wanted to have a blog and in the process redo my homepage. A friend recommended Ghost and when trying out their hosted Pro version I thought it looked great!
This is for ghost v0.11.x
. For v1.x.x
have a look at this post!
I wanted a clean and simple theme and when looking through the Ghost marketplace I found Steam. I had some experience with Handlebars already and I quickly glanced through the theme documentation. It seemed pretty straight forward.
The docs says this:
If you are developing a Ghost theme for your own site or creating themes for others to use we recommend installing Ghost on your own local machine. Luckily we have a brand new Ghost CLI to make this really easy
Lets do it!
$ npm install -g ghost-cli@latest
$ ghost install local
✖ Checking system Node.js version
A SystemError occured.
Message: The version of Node.js you are using is not supported.
Supported: ^4.5.0 || ^6.5.0
Installed: 8.1.2
Mhm. I guess there's a version manager for node
but meh.. So I went with docker:
docker run --name ghost -v /path/to/your/blog:/var/lib/ghost -p 2368:2368 -d ghost
Done.
I started messing around with the design and it didn't take long until I wanted to try and have a custom layout for a static page. I used that for my about page.
Note: The name of the file should be page-{yourPageName}.hbs
, as the article correctly says the first time, not post-{yourPageName}.hbs
.
I also thought about creating a post for each of my projects and creating a static page displaying just those posts (instead of a single post as it is right now). This is possible but I ended up not doing that.
To get the blog running on my server I just did the docker thingy again, git pulled my theme to /opt/ghost/blog/themes/
, restarted docker
and we're live!
Edit: There were two more things I had to do for docker in production.
I'm having some permission issues with the directory but apart from that it's all good.
Edit2: Permissions solved thanks to this. Just add -u $(id -u $USER):$(id -g $USER)
to the docker run
command.