Skip to content

Commit

Permalink
Update with files from Sage roots/8.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
studiorabota committed Mar 17, 2016
1 parent 2f8500b commit 558fc5a
Show file tree
Hide file tree
Showing 15 changed files with 225 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ dist
bower_components
node_modules
npm-debug.log
vendor

.DS_Store
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
### HEAD
### 8.4.2: February 19th, 2016
* Add Composer vendor directory to gitignore ([#1618](https://github.com/roots/sage/issues/1618))
* Fix build test by removing trailing space ([#1617](https://github.com/roots/sage/issues/1617))
* Replace deprecated gulp-minify-css with gulp-cssnano ([#1610](https://github.com/roots/sage/issues/1610))

### 8.4.1: January 27th, 2016
* Add `composer.json` and update installation instructions ([#1583](https://github.com/roots/sage/issues/1583))

### 8.4.0: December 1st, 2015
* Update to Bootstrap 3.3.6 ([#1578](https://github.com/roots/sage/pull/1578))
* Remove unnecessary underscore ([#1577](https://github.com/roots/sage/pull/1577))
* Drop support for older browsers ([#1571](https://github.com/roots/sage/pull/1571))
* Add support for theme customizer ([#1573](https://github.com/roots/sage/pull/1573))
* Remove extraneous no-js ([#1562](https://github.com/roots/sage/pull/1562))
Expand Down
131 changes: 105 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,138 @@
# Sage + Twig theme for Wordpress
# [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 starter theme with a modern front-end development workflow. Twig is a modern template enging.
Sage is a WordPress starter theme based on HTML5 Boilerplate, gulp, Bower, and Bootstrap Sass, that will help you make better themes.

The Sage + Twig starter theme combines the best of both.
* Source: [https://github.com/roots/sage](https://github.com/roots/sage)
* Homepage: [https://roots.io/sage/](https://roots.io/sage/)
* Documentation: [https://roots.io/sage/docs/](https://roots.io/sage/docs/)
* Twitter: [@rootswp](https://twitter.com/rootswp)
* Newsletter: [Subscribe](http://roots.io/subscribe/)
* Forum: [https://discourse.roots.io/](https://discourse.roots.io/)

>Do check out the [Timber Wiki](https://github.com/jarednova/timber/wiki). It will help you to learn Twig and how to set it up with Wordpress.
## 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

* [gulp](http://gulpjs.com/) build script that compiles both Sass and Less, checks for JavaScript errors, optimizes images, and concatenates and minifies files
* [BrowserSync](http://www.browsersync.io/) for keeping multiple browsers and devices synchronized while testing, along with injecting updated CSS and JS into your browser while you're developing
* [Bower](http://bower.io/) for front-end package management
* [asset-builder](https://github.com/austinpray/asset-builder) for the JSON file based asset pipeline
* [Bootstrap](http://getbootstrap.com/)
* [Theme wrapper](https://roots.io/sage/docs/theme-wrapper/)
* ARIA roles and microformats
* Posts use the [hNews](http://microformats.org/wiki/hnews) microformat
* [Multilingual ready](https://roots.io/wpml/) and over 30 available [community translations](https://github.com/roots/sage-translations)

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

* Cleaner output of `wp_head` and enqueued assets
* Cleaner HTML output of navigation menus
* Root relative URLs
* Nice search (`/search/query/`)
* Google CDN jQuery snippet from [HTML5 Boilerplate](http://html5boilerplate.com/)
* Google Analytics snippet from [HTML5 Boilerplate](http://html5boilerplate.com/)

See a complete working example in the [roots-example-project.com repo](https://github.com/roots/roots-example-project.com).

## Theme installation

Clone the git repo - `git clone [email protected]:studiorabota/sage-twig-theme.git` and then rename the directory to the name of your theme or website.
Bottom line is you want to get the files in this repo into your local development environment. There are many ways to do this, two of which we will cover here.

### via Command-line

If you're already [using Composer to manage WordPress](https://roots.io/using-composer-with-wordpress/), then you might consider using composer's `create-project` command to download Sage.

The example below assumes you're using Bedrock. If you're not, simply change the target path accordingly.

```sh
composer create-project roots/sage web/app/themes/your-theme-name-here
```

Then activate the theme via [wp-cli](http://wp-cli.org/commands/theme/activate/).

```sh
wp theme activate your-theme-name-here
```

### via WordPress Admin Panel

1. [Download the latest release](https://github.com/roots/sage/releases/latest) of Sage.
2. In your WordPress admin panel, navigate to Appearance->Themes
3. Click Add New
4. Click Upload Theme
5. Upload the zip file that you downloaded.

## Theme setup

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

## Installation
## Theme development

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

You will need:
### Install gulp and Bower

* [Gulp](http://gulpjs.com/)
* [Bower](http://bower.io/)
* [Composer](https://getcomposer.org/)
* [Node](http://nodejs.org/download/) - We recommend you update to the latest version of npm: `npm install -g npm@latest`.
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`
4. Run `composer update` to install the Timber plugin
5. Run `gulp`
5. Run `gulp watch`
6. Go to Plugins in wp-admin and activate Timber

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

## Adding extra data to Twig
### Available gulp commands

In `lib/timber.php` you can add extra data to be used in your Twig templates. This is only for data which needs to be available site-wide, like menus, etc.
* `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).

You can also add data in for ex. page.php, archive.php, etc. For this you should check out the Timber documentation.

## Using BrowserSync
### 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:

~~~json
```json
...
"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:
```json
...
"config": {
"devUrl": "http://localhost:8888/project-name/"
}
...
```

## Documentation

* Sage: [https://github.com/roots/sage](https://github.com/roots/sage)
* Twig: [http://twig.sensiolabs.org/](http://twig.sensiolabs.org/)
* Timber: [https://github.com/jarednova/timber/wiki](https://github.com/jarednova/timber/wiki)
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.

* Participate on the [Roots Discourse](https://discourse.roots.io/)
* Follow [@rootswp on Twitter](https://twitter.com/rootswp)
* Read and subscribe to the [Roots Blog](https://roots.io/blog/)
* Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)
26 changes: 13 additions & 13 deletions assets/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@import "common/_variables";
@import "common/variables";

// Automatically injected Bower dependencies via wiredep (never manually edit this block)
// bower:scss
@import "../../bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss";
// endbower

@import "common/_global";
@import "components/_buttons";
@import "components/_comments";
@import "components/_forms";
@import "components/_grid";
@import "components/_wp-classes";
@import "layouts/_header";
@import "layouts/_sidebar";
@import "layouts/_footer";
@import "layouts/_pages";
@import "layouts/_posts";
@import "layouts/_tinymce";
@import "common/global";
@import "components/buttons";
@import "components/comments";
@import "components/forms";
@import "components/grid";
@import "components/wp-classes";
@import "layouts/header";
@import "layouts/sidebar";
@import "layouts/footer";
@import "layouts/pages";
@import "layouts/posts";
@import "layouts/tinymce";
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"private": true,
"dependencies": {
"bootstrap-sass": "3.3.5"
"bootstrap-sass": "3.3.6"
},
"overrides": {
"bootstrap-sass": {
Expand Down
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* @link https://github.com/roots/sage/pull/1042
*/
$sage_includes = [
'lib/timber.php', // Twig magic
'lib/assets.php', // Scripts and stylesheets
'lib/extras.php', // Custom functions
'lib/setup.php', // Theme setup
'lib/titles.php', // Page titles
'lib/customizer.php' // Theme customizer,
'lib/timber.php', // Twig magic
'lib/assets.php', // Scripts and stylesheets
'lib/extras.php', // Custom functions
'lib/setup.php', // Theme setup
'lib/titles.php', // Page titles
'lib/customizer.php' // Theme customizer
];

foreach ($sage_includes as $file) {
Expand All @@ -25,4 +25,4 @@

require_once $filepath;
}
unset($file, $filepath);
unset($file, $filepath);
7 changes: 3 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var jshint = require('gulp-jshint');
var lazypipe = require('lazypipe');
var less = require('gulp-less');
var merge = require('merge-stream');
var minifyCss = require('gulp-minify-css');
var cssNano = require('gulp-cssnano');
var plumber = require('gulp-plumber');
var rev = require('gulp-rev');
var runSequence = require('run-sequence');
Expand Down Expand Up @@ -104,9 +104,8 @@ var cssTasks = function(filename) {
'opera 12'
]
})
.pipe(minifyCss, {
advanced: false,
rebase: false
.pipe(cssNano, {
safe: true
})
.pipe(function() {
return gulpif(enabled.rev, rev());
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sage",
"version": "8.3.0",
"version": "8.4.2",
"author": "Ben Word <[email protected]>",
"homepage": "https://roots.io/sage/",
"private": true,
Expand Down Expand Up @@ -34,12 +34,12 @@
"gulp-autoprefixer": "^2.3.1",
"gulp-changed": "^1.3.0",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.0",
"gulp-flatten": "0.1.1",
"gulp-if": "^1.2.5",
"gulp-imagemin": "^2.3.0",
"gulp-jshint": "^1.11.2",
"gulp-less": "^3.0.3",
"gulp-minify-css": "^1.2.0",
"gulp-plumber": "^1.0.1",
"gulp-rename": "^1.2.2",
"gulp-rev": "^6.0.0",
Expand Down
14 changes: 7 additions & 7 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Theme Name: Sage + Timber starter theme
Theme URI: https://github.com/studiorabota/sage
Description: Sage + Timber is a WordPress starter theme. <a href="https://github.com/studiorabota/sage">Contribute on GitHub</a>
Version: 0.0.0
Author: Studio Rabota
Author URI: https://studiorabota.com/
Text Domain: sage-timber
Theme Name: Sage Starter Theme
Theme URI: https://roots.io/sage/
Description: Sage is a WordPress starter theme. <a href="https://github.com/roots/sage">Contribute on GitHub</a>
Version: 8.4.2
Author: Roots
Author URI: https://roots.io/
Text Domain: sage
License: MIT License
License URI: http://opensource.org/licenses/MIT
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
namespace Composer\Autoload;

/**
* ClassLoader implements a PSR-0 class loader
*
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
Expand All @@ -39,6 +37,8 @@
*
* @author Fabien Potencier <[email protected]>
* @author Jordi Boggiano <[email protected]>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
Expand Down Expand Up @@ -147,7 +147,7 @@ public function add($prefix, $paths, $prepend = false)
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-0 base directories
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
Expand Down
Loading

0 comments on commit 558fc5a

Please sign in to comment.