Tools I Use to Develop, Edit and Deploy Ghost Themes
Tags: ghost, tools, gulp, blogging
Published: 2021-03-05 13:52:03

---
title: Tools I Use to Develop, Edit and Deploy Ghost Themes
published: true
description: In this issue, I would like to share the tools I use to build Ghost themes professionally. I will divide it into four sections. The editor, the command-line tool, producing the zip file to be ready to upload and an alternative way to deploy the theme to your website using GitHub.
tags: Ghost, Tools, Gulp, blogging
cover_image: https://d33wubrfki0l68.cloudfront.net/fc02aa80d705ccfe04d7843e8399608636cf3936/66587/images/posts/tools-ghost/tools.jpg
---

In this issue, I would like to share the tools I use to build Ghost themes professionally at [Aspire Themes](https://aspirethemes.com/).

I will divide it into four sections. The editor, the command-line tool, producing the zip file to be ready to upload and an alternative way to deploy the theme to your website using GitHub.

### 1) Editor
I use [Visual Studio Code](https://code.visualstudio.com/) as my main code editor. It is free, open-source, and runs on all operating systems. A good alternative is [Sublime Text](https://www.sublimetext.com/).

### 2) Command Line

I use [iTerm2](https://iterm2.com/index.html) as a command-line tool on macOS Big Sur. It is an open-source replacement for the macOS Terminal. You are fine to use the built-in Terminal if you don't want the extra features that iTerm2 provides.

### 3) Zip

I use [gulp.js](https://gulpjs.com/) as an automation toolkit to automate my development workflow. One of the available add-ons is [gulp-zip](https://www.npmjs.com/package/gulp-zip). This plugin aims to compress the theme files into a final zip file ready for upload.

My current gulp zip task is something like.

```js
gulp.task('zip', function () {
  return gulp.src([
    './**',
    '!node_modules/**',
    '!bower_components/**',
    '!.git/**',
    '!.DS_Store'
  ], { dot: true })
  .pipe(zip('NAME.zip'))
  .pipe(gulp.dest('../'))
  done();
});
```

So, with the `gulp zip` command, I can export the final theme file.

*Change `NAME` to your theme directory name.*

---

If you are not using gulp and want a simple command line to zip the theme, you can use something like.

```bash
zip -r NAME.zip NAME -x '*node_modules*' '*bower_components*'
```

What comes after the `-x` option is a way to exclude different directories or files. This is useful to exclude development files that are not important in production. In this case, we are excluding the `node_modules` and `bower_components` directories from the final zip file. Not every theme will have these directories. But If you are using nvm, bower, or git to develop your theme, there is no need to include these in the final theme file. In one case, they will be large and not required at all to install your theme successfully.

If you are not using gulp or don't have any files to exclude, you can compress the theme by doing the following.

1. Select the theme folder.
2. **Right-click** to bring up the pop-up menu.
3. Choose **Compress** *"filename"*.

The above steps applied to macOS, but you can find something similar for other operating systems.

### 4) Deployment

I use the [Deploy Ghost Theme](https://github.com/marketplace/actions/deploy-ghost-theme) Github action. This tool helps with theme deployment. This means that instead of zipping your theme, upload it to your website every time you make a change. You can now deploy your theme to your website every time you push a new commit to your theme GitHub repository.

I wrote a step by step guide about it at [How to Deploy Your Ghost Theme Using Github Actions](https://aspirethemes.com/blog/deploy-ghost-theme)

---

#### My Current Setup

In case you are wondering what my current environment set up is and which package versions I use, take a look at the following:

```bash
$ node -v
v10.16.0

$ npm -v
6.14.8

$ bower -v
1.8.8

$ gulp -v
CLI version: 2.2.0
Local version: 4.0.2
```

This environment works well for running Ghost and also for theme development.

I'm using a macOS Big Sur.

---

That's it for today, and I hope you find this useful.