Skip to content
Demo user edited this page Apr 4, 2015 · 2 revisions

# [Sage](https://roots.io/sage/) [![Build Status](https://travis-ci.org/roots/sage.svg)](https://travis-ci.org/roots/sage) [![devDependency Status](https://david-dm.org/roots/sage/dev-status.svg)](https://david-dm.org/roots/sage#info=devDependencies)

Sage is a WordPress starter theme based on HTML5 Boilerplate, gulp, Bower, and Bootstrap, that will help you make better themes.

## Requirements

Prerequisite | How to check | How to install
--------------- | ------------ | ------------- |
PHP >= 5.4.x | php -v | [php.net](http://php.net/manual/en/install.php) |
Node.js 0.12.x | node -v | [nodejs.org](http://nodejs.org/) |
gulp >= 3.8.10 | gulp -v | npm install -g gulp |
Bower >= 1.3.12 | bower -v | npm install -g bower |

For more installation notes, refer to the [Install gulp and Bower](#install-gulp-and-bower) section in this document.

## Features

Install the [Soil](https://github.com/roots/soil) plugin to enable additional features:

  • Cleaner output of wp_head and enqueued assets
  • Root relative URLs
  • Nice search (/search/query/)

## Installation

Clone the git repo - git clone https://github.com/roots/sage.git and then rename the directory to the name of your theme or website.

If you don't use [Bedrock](https://github.com/roots/bedrock), you'll need to add the following to your wp-config.php on your development installation:

define('WP_ENV', 'development');

## Configuration

Edit lib/config.php to enable or disable theme features

Edit lib/init.php to setup navigation menus, post thumbnail sizes, post formats, and sidebars.

## Theme development

Sage uses [gulp](http://gulpjs.com/) as its build system and [Bower](http://bower.io/) to manage front-end packages.

### Install gulp and Bower

Building the theme requires [node.js](http://nodejs.org/download/). We recommend you update to the latest version of npm: npm install -g npm@latest.

From the command line:

  1. Install [gulp](http://gulpjs.com) and [Bower](http://bower.io/) globally with npm install -g gulp bower
  2. Navigate to the theme directory, then run npm install
  3. Run bower install

You now have all the necessary dependencies to run the build process.

### Available gulp commands

  • gulp — Compile and optimize the files in your assets directory
  • gulp watch — Compile assets when file changes are made
  • gulp --production — Compile assets for production (no source maps).

### Using BrowserSync

To use BrowserSync during gulp watch you need to update devUrl at the bottom of assets/manifest.json to reflect your local development hostname.

For example, if your local development URL is http://project-name.dev you would update the file to read:

...
  "config": {
    "devUrl": "http://project-name.dev"
  }
...
If your local develoment URL looks like http://localhost:8888/project-name/ you would update the file to read:
...
  "config": {
    "devUrl": "http://localhost:8888/project-name/"
  }
...

## Documentation

Sage documentation is available at [https://roots.io/sage/docs/](https://roots.io/sage/docs/).

## Contributing

Contributions are welcome from everyone. We have [contributing guidelines](CONTRIBUTING.md) to help you get started.

## Community

Keep track of development and community news.

Clone this wiki locally