Skip to content

foreleven/Ghost-Theme-Webpack-Boilerplate

 
 

Repository files navigation

Ghost Theme Webpack Boilerplate

This is a boilerplate for developing complex themes/applications for the Ghost Publishing Platform

The boilerplate supports typescript, cssnext, Sass, and ES6 out of the box. Tests, Linting, typecheckers, etc are left for the user to configure.

Prerequisites

To use this boilerplate you need to have

  • A local installation of Ghost
  • An installation of Node and Npm

Installing

  1. Clone the boilerplate and install the dev-dependencies
$ mkdir my-theme
$ git clone git@github.com:villiampoignant/Ghost-Theme-Webpack-Boilerplate.git ./my-theme
$ cd my-theme
$ npm install
  1. Update package.json according to reference your own project

  2. Create a symlink to your ghost server install directory

$ ln -s /full/path/to/my-theme/dist /full/path/to/ghost-install-dir/content/themes/my-theme

Development

$ npm run dev will do the following:

  • Compile all code in ./src/app to ./dist/assets/app.js.
  • Copy over everyting in ./src/theme/ to ./dist/.
  • Watch ./src for changes.
  • Start a Live Reload server.

If you have symlinked the ./dist folder to your ghost's theme dir and enabled the theme, you should have fully functional Live Reload on http://localhost:2368/

Deployment

Build scripts:

$ npm run build:

  • Compile and minify ./src/app to ./dist
  • Copy everyting in ./src/theme/ to ./dist/

$ npm run zip:

  • Zips ./dist to ./dist-zipped/[my-theme].zip

$ npm run build:zip:

  • Runs $ npm run build
  • Runs $ npm run zip (who could have guessed.. 😏)

Contributing

If you have any questions, improvments or comments, please send me a PM or PR.

Authors

Me 🌞

License

This project is licensed under the MIT License - see the LICENSE.md file for details

The boilerplate does not include

  • Tests
  • Static Typecheckers for JS

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 51.9%
  • HTML 37.8%
  • JavaScript 10.3%