bcc-Sage is the theme for the BCcampus marketing site, based on Sage.
- Sass for stylesheets
- ES6 for JavaScript
- Webpack for compiling assets, optimizing images, and concatenating and minifying files
- Browsersync for synchronized browser testing
- Laravel Blade as a templating engine
- Controller for passing data to Blade templates
- CSS framework options:
- Bootstrap 4
- Bulma
- Foundation
- Tachyons
- None (blank slate)
- Font Awesome (optional)
See a working example at roots-example-project.com.
Make sure all dependencies have 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):
# @ app/themes/ or wp-content/themes/
$ composer create-project roots/sage your-theme-name dev-masterDuring theme installation you will have the options to:
- Update theme headers (theme name, description, author, etc.)
- Select a CSS framework (Bootstrap, Foundation, Tachyons, none)
- Add Font Awesome
- Configure Browsersync (path to theme, local development URL)
themes/your-theme-name/ # β Root of your Sage based theme
βββ app/ # β Theme PHP
β βββ controllers/ # β Controller files
β βββ admin.php # β Theme customizer setup
β βββ filters.php # β Theme filters
β βββ helpers.php # β Helper functions
β βββ setup.php # β Theme setup
βββ composer.json # β Autoloading for `app/` files
βββ composer.lock # β Composer lock file (never edit)
βββ dist/ # β Built theme assets (never edit)
βββ node_modules/ # β Node.js packages (never edit)
βββ package.json # β Node.js dependencies and scripts
βββ resources/ # β Theme assets and templates
β βββ assets/ # β Front-end assets
β β βββ config.json # β Settings for compiled assets
β β βββ build/ # β Webpack and ESLint config
β β βββ fonts/ # β Theme fonts
β β βββ images/ # β Theme images
β β βββ scripts/ # β Theme JS
β β βββ styles/ # β Theme stylesheets
β βββ functions.php # β Composer autoloader, theme includes
β βββ index.php # β Never manually edit
β βββ screenshot.png # β Theme screenshot for WP admin
β βββ style.css # β Theme meta information
β βββ views/ # β Theme templates
β βββ layouts/ # β Base templates
β βββ partials/ # β Partial templates
βββ vendor/ # β Composer packages (never edit)Edit app/setup.php to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.
- Run
yarnfrom the theme directory to install dependencies - Update
resources/assets/config.jsonsettings:devUrlshould reflect your local development hostnamepublicPathshould reflect your WordPress folder structure (/wp-content/themes/sagefor non-Bedrock installs)
yarn run startβ Compile assets when file changes are made, start Browsersync sessionyarn run buildβ Compile and optimize the files in your assets directoryyarn run build:productionβ Compile assets for production