Stephen Edgar 07aec245a3 Add npm prune to Travis CI
> Via https://docs.npmjs.com/cli/prune
> > This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are removed.
> >
> > Extraneous packages are packages that are not listed on the parent package's dependencies list.

The reason for adding this is to go hand in hand with the Travis CI caching implemented a while ago, if you don't run `npm prune` periodically then older packages will not be removed from the cache and the cache will continue to grow in size.

I suspect if you compare the Travis CI cache size between master and this PR, this PR will be significantly smaller. (You could also inspect the cache with Travis CI CLI I think)

https://travis-ci.org/roots/sage/caches
2016-06-09 09:46:51 +10:00
2016-03-11 18:06:28 -05:00
2016-03-13 17:08:30 -04:00
2016-02-14 22:48:03 +01:00
2016-06-09 09:46:51 +10:00
2016-02-19 15:50:10 -07:00
2016-04-03 17:03:42 -05:00
2013-11-07 21:28:52 -06:00
2016-05-21 18:36:38 +02:00
2016-04-02 22:45:08 -05:00
2016-03-11 18:00:05 -05:00
2016-03-30 10:03:18 -04:00

Sage

Build Status devDependency Status

Sage is a WordPress starter theme with a modern development workflow.

Write stylesheets with Sass, automatically check your JavaScript for errors, optimize images, enable synchronized browser testing, and more.

Features

  • Webpack is used as a build tool for compiling stylesheets, checking for JavaScript errors, optimizing images, and concatenating and minifying files
  • BrowserSync for keeping multiple browsers and devices synchronized while testing, along with injecting updated CSS and JS into your browser while you're developing
  • Bootstrap
  • Template inheritance with the theme wrapper
  • ARIA roles and microformats
  • Posts use the hNews microformat
  • Multilingual ready and over 30 available community translations

Install the Soil plugin to enable additional recommended features:

  • Load jQuery from the jQuery CDN
  • Cleaner WordPress markup
  • Cleaner HTML output of navigation menus
  • Root relative URLs
  • Nice search
  • Google Analytics snippet from HTML5 Boilerplate
  • Move all JS to the footer
  • Disable trackbacks and pingbacks

See a complete working example in the roots-example-project.com repo.

Requirements

Make sure all dependencies have been installed before moving on:

Theme installation

From the command line, run the following commands from the root of your WordPress site (where composer.json exists). These instructions assume you're using a Bedrock-based WordPress setup. If you're using Vagrant, make sure to run these commands from the Vagrant box (vagrant ssh). Create a new theme based on Sage by using Composer's create-project:

# @ example.com/site
$ composer create-project roots/sage web/app/themes/your-theme-name dev-sage-9

Then activate the theme via wp-cli:

# @ example.com/site
$ wp theme activate your-theme-name

Theme structure

themes/theme-name/        # → Root of your Sage based theme
├── assets                # → Front-end assets
│   ├── config.json       # → Settings for compiled assets
│   ├── fonts/            # → Theme fonts
│   ├── images/           # → Theme images
│   ├── scripts/          # → Theme JS
│   └── styles/           # → Theme stylesheets
├── composer.json         # → Autoloading for `src/` files
├── composer.lock         # → Composer lock file (never manually edit)
├── dist/                 # → Built theme assets (never manually edit)
├── functions.php         # → Never manually edit
├── index.php             # → Never manually edit
├── node_modules/         # → Node.js packages (never manually edit)
├── package.json          # → Node.js dependencies and scripts
├── screenshot.png        # → Theme screenshot for WP admin
├── src/                  # → Theme PHP
├── style.css             # → Theme meta information
├── templates/            # → Theme templates
│   ├── layouts/          # → Base templates
│   └── partials/         # → Partial templates
├── vendor/               # → Composer packages (never manually edit)
├── watch.js              # → Webpack/BrowserSync watch config
└── webpack.config.js     # → Webpack config

Theme setup

Edit src/lib/setup.php to enable or disable theme features, setup navigation menus, post thumbnail sizes, post formats, and sidebars.

Theme development

Sage uses Webpack as a build tool and npm to manage front-end packages.

Install dependencies

From the command line on your host machine (not on your Vagrant development box), navigate to the theme directory then run npm install:

# @ example.com/site/web/app/themes/your-theme-name
$ npm install

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

Available build commands

  • npm run build — Compile and optimize the files in your assets directory
  • npm run watch — Compile assets when file changes are made, start BrowerSync session
  • npm run build:production — Compile assets for production

Using BrowserSync

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

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

...
  "devUrl": "https://project-name.dev",
...

Documentation

Sage documentation is available at https://roots.io/sage/docs/.

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Community

Keep track of development and community news.

Description
Customised by Bad Egg Digital
https://roots.io/sage/
Readme 12 MiB
Languages
PHP 46.6%
SCSS 29.7%
JavaScript 11.6%
Blade 11.6%
CSS 0.5%