Skip to Content
Published on
Takes approximately 2 minutes to read
Post History

Ghost Scaffolding

This post was archived on .

The content may be old and no longer accurate.

The Ghost Blog logo.

Introduction

I believe that upgrades should be simple, as such, I really hate dealing with zips and messing around in Ghost's core directory just to get the thing updated. Being the lazy developer that I am, I created this mini-project called Slight Ghost - a simple scaffolding for a Ghost blog, optimised for streamlined updates.

Install

Make sure git and node is installed before attempting to install slight-ghost

Bash
code block
Skip
# Ubuntu
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install git node

Installing is as simple as a git clone. First clone the scaffolding.

Bash
code block
Skip
cd /var/www/
git clone https://github.com/Silvenga/Slight-Ghost.git ghost
cd ghost

Clone the default theme.

Bash
code block
Skip
git submodule update --init --recursive

Install Ghost and its dependencies.

Bash
code block
Skip
npm install

Copy the sample configuration file.

Bash
code block
Skip
cp config.sample.js config.js

And edit config.js for your own needs.

Bash
code block
Skip
nano config.js

Note: Make sure to include the paths.contentPath directive.

Done! Checkout the Upgrade section for information on how to upgrade.

Run

Run slight-ghost just like the normal installation of Ghost. I recommend using Upstart to keep Ghost running (https://silvenga.com/power-ghost-with-upstart/).

Bash
code block
Skip
node index.js

Notes: index.js will automatically set Ghost into production mode. An export NODE_ENV=production is not needed. Make sure to change the permissions of the content directory!

Upgrade

Update the base scaffolding and the default theme using git.

Bash
code block
Skip
git pull --recurse-submodules

Updated and install any new dependencies using npm.

Bash
code block
Skip
npm install

Done! Ghost has been updated to the latest stable revision - no need to deal with those pesky zips.

Advance

Update the content directory. This is normally not required.

Switch the repository to a scratch branch.

Bash
code block
Skip
git checkout ghost

Get the latest stable version of Ghost to base the scaffolding off of.

Bash
code block
Skip
git pull https://github.com/TryGhost/Ghost.git stable

Switch back to our original branch.

Bash
code block
Skip
git checkout master

Merge the content directory to the scaffolding.

Bash
code block
Skip
git checkout ghost -- content

Done! The content directory should now be updated to the latest version of Ghost.

License

This project is under the MIT license, fork away!