ghost-theme-development icon indicating copy to clipboard operation
ghost-theme-development copied to clipboard

Ghost (http://ghost.org) Theme development environment

Ghost Template development environment

  • Requirements
  • Installation of dependencies
  • Building
  • Serving the files with a local webserver
  • Sublime Text

Requirements

  1. nodejs, On a mac fetch it with homebrew: brew install node
  2. gulp, Install via npm if you don't have it: npm install -g gulp
  3. bower, Install via npm if you don't have it: npm install -g bower

Installation of dependencies

Execute the following commands while in the package dir (package.json lies there):

  • npm install
  • bower install

It will fetch a lot of gulp plugins, a ghost package and the inuitcss framework.

Building

There are three main targets for building:

  • default (just run gulp without arguments), builds the complete theme and dumps to content/themes/dev/
  • livereload (run gulp livereload) starts a file watcher and a livereload server, and a ghost demo instance. connect your browser to that server (or just depend on the inserted javascript shim) to get a live preview while editing templates or css
  • dist (run gulp dist) packs up the template in dev-theme.zip and removes livereload and .map files.

Serving the files with a local webserver

Just use the gulp task livereload:

gulp livereload

This will run a demo ghost instance on http://localhost:2368 (user template, email: [email protected], password: template) with the dev-theme preselected.

Sublime Text

If you're using Sublime Text, please open the template-dev project, it hides all things that are not neccessary for developing a template.

Furthermore it defines 2 build targets:

  • build for just compiling the template
  • preview for running a ghost instance and enabling live reload for your browser