A custom WordPress build utilizing `Sage`/`Bedrock`/`Trello` stack from `Roots.io` for Good Success.
Sage is a WordPress starter theme based on HTML5 Boilerplate, gulp, Bower, and Bootstrap Sass, that will help you make better themes.
Prerequisite | How to check | How to install |
---|---|---|
PHP >= 5.4.x | php -v |
php.net |
Node.js >= 4.5 | node -v |
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 section in this document.
Install the Soil plugin to enable additional features:
wp_head
and enqueued assets/search/query/
)See a complete working example in the roots-example-project.com repo.
Install Sage by copying the project into a new folder within your WordPress themes directory.
Make sure Composer has been installed before moving on.
Install Sage using Composer from your WordPress themes directory (replace your-theme-name
below with the name of your theme):
# @ example.com/site/web/app/themes/
$ composer create-project roots/sage your-theme-name 8.5.1
Edit lib/setup.php
to enable or disable theme features, setup navigation menus, post thumbnail sizes, post formats, and sidebars.
Sage uses gulp as its build system and Bower to manage front-end packages.
Building the theme requires node.js. We recommend you update to the latest version of npm: npm install -g npm@latest
.
From the command line:
npm install -g gulp bower
npm install
bower install
You now have all the necessary dependencies to run the build process.
gulp
— Compile and optimize the files in your assets directorygulp watch
— Compile assets when file changes are madegulp --production
— Compile assets for production (no source maps).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 development URL looks like http://localhost:8888/project-name/
you would update the file to read:
...
"config": {
"devUrl": "http://localhost:8888/project-name/"
}
...
Sage documentation is available at https://roots.io/sage/docs/.
Contributions are welcome from everyone. We have contributing guidelines to help you get started.
Keep track of development and community news.