Skip to content

rdallaire/bonsai

Repository files navigation

Bonsai

WordPress starter theme using Gulp, Foundation & SASS.

Checkout yo-bonsai, a yeoman generator for bonsai that will automate the theme even more!

Goals

  • Quickly develop WordPress themes that can be used by anyone.
  • Develop custom WordPress sites for invidual use.
  • Lean compressed assets with minimal HTTP requests.

Features

Installation

Install gulp and bower globally if not already installed.

npm install gulp -g
npm install bower -g

Install node modules and bower components. (This will run bower install)

npm install

Gulp Commands

  • gulp - build the project once
  • gulp watch - watch for file changes, build the assets, run livereload
  • gulp dist - compile all/ move all files ready for production

Organization

Brief overview of the folders used in Bonsai. Gulp is used to generate the build and dist folders where the compiled & optimized files live.

  • src/: Edit files here. All raw sass, images, php files are here.
  • build/: Used for development of the theme. SASS is compiled here. Images are compressed and placed here. gulp and gulp watch will create the buld folder. You can symlink your build/ folder to your themes folder. (example below)
  • dist/: The distribution version of the theme lives. gulp dist creates the distribution.
  • dist/theme: This is the final code files with no source maps, all assets are optimized.

Symlink in windows example

mklink /D c:\xampp\htdocs\wordpress\wp-content\themes\my-theme c:\dev\projects\bonsai\build\

Setup

The following names are used throughout the theme for easy search/ replace.

You can also use yo-bonsai to auto generate these.

themeName > Theme Name

themeHandle > Theme_Name

themeFunction > theme_name

themeTextDomain > theme-name

License

Copyright 2015 Ross Dallaire. GNU General Public License v2 or later http://www.gnu.org/licenses/gpl-2.0.html