Skip to content

Commit

Permalink
Merge pull request #982 from roots/7.0.0
Browse files Browse the repository at this point in the history
Roots 7.0.0
  • Loading branch information
retlehs committed Jul 3, 2014
2 parents 6c09c17 + 1788272 commit 17716e5
Show file tree
Hide file tree
Showing 171 changed files with 594 additions and 21,124 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "assets/vendor"
}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
node_modules
assets/css/main.min.css.map
assets/vendor/*
assets/css/main.css.map
assets/css/*main*.css
assets/js/*scripts*.js
assets/js/vendor/modernizr.min.js
assets/manifest.json
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
### HEAD
* Update to Bootstrap 3.1.1
### 7.0.0: TBD
* Updated Grunt workflow
* Use grunt-modernizr to make a lean Modernizr build
* Use Bower for front-end package management
* Update to Bootstrap 3.2.0
* Updage to Modernizr 2.8.2
* Update to jQuery 1.11.1
* Move clean up, relative URLs, and nice search to [Soil](https://github.com/roots/soil)
* Update LESS organization
* Move [community translations](https://github.com/roots/roots-translations) to separate repository

### 6.5.2: February 4th, 2014
* Update to Bootstrap 3.1.0
Expand Down
166 changes: 108 additions & 58 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
'use strict';
module.exports = function(grunt) {
// Load all tasks
require('load-grunt-tasks')(grunt);
// Show elapsed time
require('time-grunt')(grunt);

var jsFileList = [
'assets/vendor/bootstrap/js/transition.js',
'assets/vendor/bootstrap/js/alert.js',
'assets/vendor/bootstrap/js/button.js',
'assets/vendor/bootstrap/js/carousel.js',
'assets/vendor/bootstrap/js/collapse.js',
'assets/vendor/bootstrap/js/dropdown.js',
'assets/vendor/bootstrap/js/modal.js',
'assets/vendor/bootstrap/js/tooltip.js',
'assets/vendor/bootstrap/js/popover.js',
'assets/vendor/bootstrap/js/scrollspy.js',
'assets/vendor/bootstrap/js/tab.js',
'assets/vendor/bootstrap/js/affix.js',
'assets/js/plugins/*.js',
'assets/js/_*.js'
];

grunt.initConfig({
jshint: {
Expand All @@ -9,75 +30,111 @@ module.exports = function(grunt) {
all: [
'Gruntfile.js',
'assets/js/*.js',
'!assets/js/scripts.min.js'
'!assets/js/scripts.js',
'!assets/**/*.min.*'
]
},
less: {
dist: {
dev: {
files: {
'assets/css/main.min.css': [
'assets/less/app.less'
'assets/css/main.css': [
'assets/less/main.less'
]
},
options: {
compress: true,
compress: false,
// LESS source map
// To enable, set sourceMap to true and update sourceMapRootpath based on your install
sourceMap: false,
sourceMapFilename: 'assets/css/main.min.css.map',
sourceMap: true,
sourceMapFilename: 'assets/css/main.css.map',
sourceMapRootpath: '/app/themes/roots/'
}
},
build: {
files: {
'assets/css/main.min.css': [
'assets/less/main.less'
]
},
options: {
compress: true
}
}
},
concat: {
options: {
separator: ';',
},
dist: {
src: [jsFileList],
dest: 'assets/js/scripts.js',
},
},
uglify: {
dist: {
files: {
'assets/js/scripts.min.js': [
'assets/js/plugins/bootstrap/transition.js',
'assets/js/plugins/bootstrap/alert.js',
'assets/js/plugins/bootstrap/button.js',
'assets/js/plugins/bootstrap/carousel.js',
'assets/js/plugins/bootstrap/collapse.js',
'assets/js/plugins/bootstrap/dropdown.js',
'assets/js/plugins/bootstrap/modal.js',
'assets/js/plugins/bootstrap/tooltip.js',
'assets/js/plugins/bootstrap/popover.js',
'assets/js/plugins/bootstrap/scrollspy.js',
'assets/js/plugins/bootstrap/tab.js',
'assets/js/plugins/bootstrap/affix.js',
'assets/js/plugins/*.js',
'assets/js/_*.js'
'assets/js/scripts.min.js': [jsFileList]
}
}
},
autoprefixer: {
options: {
browsers: ['last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12']
},
dev: {
options: {
map: 'assets/css/'
},
src: 'assets/css/main.css'
},
build: {
src: 'assets/css/main.min.css'
}
},
modernizr: {
build: {
devFile: 'assets/vendor/modernizr/modernizr.js',
outputFile: 'assets/js/vendor/modernizr.min.js',
files: {
'src': [
['assets/js/scripts.min.js'],
['assets/css/main.min.css']
]
},
options: {
// JS source map: to enable, uncomment the lines below and update sourceMappingURL based on your install
// sourceMap: 'assets/js/scripts.min.js.map',
// sourceMappingURL: '/app/themes/roots/assets/js/scripts.min.js.map'
}
uglify: true,
parseFiles: true
}
},
version: {
options: {
file: 'lib/scripts.php',
css: 'assets/css/main.min.css',
cssHandle: 'roots_main',
js: 'assets/js/scripts.min.js',
jsHandle: 'roots_scripts'
default: {
options: {
format: true,
length: 32,
manifest: 'assets/manifest.json',
querystring: {
style: 'roots_css',
script: 'roots_js'
}
},
files: {
'lib/scripts.php': 'assets/{css,js}/{main,scripts}.min.{css,js}'
}
}
},
watch: {
less: {
files: [
'assets/less/*.less',
'assets/less/bootstrap/*.less'
'assets/less/**/*.less'
],
tasks: ['less', 'version']
tasks: ['less:dev', 'autoprefixer:dev']
},
js: {
files: [
jsFileList,
'<%= jshint.all %>'
],
tasks: ['jshint', 'uglify', 'version']
tasks: ['jshint', 'concat']
},
livereload: {
// Browser live reloading
Expand All @@ -86,38 +143,31 @@ module.exports = function(grunt) {
livereload: false
},
files: [
'assets/css/main.min.css',
'assets/js/scripts.min.js',
'assets/css/main.css',
'assets/js/scripts.js',
'templates/*.php',
'*.php'
]
}
},
clean: {
dist: [
'assets/css/main.min.css',
'assets/js/scripts.min.js'
]
}
});

// Load tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-wp-version');

// Register tasks
grunt.registerTask('default', [
'clean',
'less',
'uglify',
'version'
'dev'
]);
grunt.registerTask('dev', [
'watch'
'jshint',
'less:dev',
'autoprefixer:dev',
'concat'
]);
grunt.registerTask('build', [
'jshint',
'less:build',
'autoprefixer:build',
'uglify',
'modernizr',
'version'
]);

};
95 changes: 63 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,91 @@
# [Roots Theme](http://roots.io/)
# [Roots Starter Theme](http://roots.io/)

[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

Roots is a WordPress starter theme based on [HTML5 Boilerplate](http://html5boilerplate.com/) & [Bootstrap](http://getbootstrap.com/) that will help you make better themes.

* Source: [https://github.com/roots/roots](https://github.com/roots/roots)
* Home Page: [http://roots.io/](http://roots.io/)
* Twitter: [@retlehs](https://twitter.com/retlehs)
* Homepage: [http://roots.io/](http://roots.io/)
* Documentation: [http://roots.io/docs/](http://roots.io/docs/)
* Twitter: [@rootswp](https://twitter.com/rootswp), [@retlehs](https://twitter.com/retlehs), [@swalkinshaw](https://twitter.com/swalkinshaw), [@Foxaii](https://twitter.com/Foxaii), [@c2foryou](https://twitter.com/c2foryou)
* Newsletter: [Subscribe](http://roots.io/subscribe/)
* Forum: [http://discourse.roots.io/](http://discourse.roots.io/)

## Features

* [Grunt](http://roots.io/using-grunt-for-wordpress-theme-development/) for compiling LESS to CSS, checking for JS errors, live reloading, concatenating and minifying files, versioning assets, and generating lean Modernizr builds
* [Bower](http://bower.io/) for front-end package management
* [HTML5 Boilerplate](http://html5boilerplate.com/)
* The latest [jQuery](http://jquery.com/) via Google CDN, with a local fallback
* The latest [Modernizr](http://modernizr.com/) build for feature detection, with lean builds with Grunt
* An optimized Google Analytics snippet
* [Bootstrap](http://getbootstrap.com/)
* Organized file and template structure
* ARIA roles and microformats
* [Theme activation](http://roots.io/roots-101/#theme-activation)
* [Theme wrapper](http://roots.io/an-introduction-to-the-roots-theme-wrapper/)
* Cleaner HTML output of navigation menus
* Posts use the [hNews](http://microformats.org/wiki/hnews) microformat
* [Multilingual ready](http://roots.io/wpml/) and over 30 available [community translations](https://github.com/roots/roots-translations)

### Additional features

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

* Root relative URLs
* Nice search (`/search/query/`)
* Cleaner output of `wp_head` and enqueued assets markup
* Image captions use `<figure>` and `<figcaption>`

## Installation

Clone the git repo - `git clone git://github.com/roots/roots.git` - or [download it](https://github.com/roots/roots/zipball/master) and then rename the directory to the name of your theme or website. [Install Grunt](http://gruntjs.com/getting-started), and then install the dependencies for Roots contained in `package.json` by running the following from the Roots theme directory:
Clone the git repo - `git clone git://github.com/roots/roots.git` - or [download it](https://github.com/roots/roots/zipball/master) 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:

```php
define('WP_ENV', 'development');
```
npm install
```

## Theme activation

Reference the [theme activation](http://roots.io/roots-101/#theme-activation) documentation to understand everything that happens once you activate Roots.

## Theme Development
## Configuration

After you've installed Grunt and ran `npm install` from the theme root, use `grunt watch` to watch for updates to your LESS and JS files and Grunt will automatically re-build as you write your code.
Edit `lib/config.php` to enable or disable theme features and to define a Google Analytics ID.

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

Edit `lib/config.php` to enable or disable support for various theme functions and to define constants that are used throughout the theme.
## Theme development

Edit `lib/init.php` to setup custom navigation menus and post thumbnail sizes.
Roots uses [Grunt](http://gruntjs.com/) for compiling LESS to CSS, checking for JS errors, live reloading, concatenating and minifying files, versioning assets, and generating lean Modernizr builds.

## Documentation
If you'd like to use Bootstrap Sass, look at the [Roots Sass](https://github.com/roots/roots-sass) fork.

### [Roots Docs](http://roots.io/docs/)
### Install Grunt

* [Roots 101](http://roots.io/roots-101/) — A guide to installing Roots, the files and theme organization
* [Theme Wrapper](http://roots.io/an-introduction-to-the-roots-theme-wrapper/) — Learn all about the theme wrapper
* [Build Script](http://roots.io/using-grunt-for-wordpress-theme-development/) — A look into the Roots build script powered by Grunt
* [Roots Sidebar](http://roots.io/the-roots-sidebar/) — Understand how to display or hide the sidebar in Roots
**Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding.

## Features
From the command line:

* Organized file and template structure
* HTML5 Boilerplate's markup along with ARIA roles and microformat
* Bootstrap
* [Grunt build script](http://roots.io/using-grunt-for-wordpress-theme-development/)
* [Theme activation](http://roots.io/roots-101/#theme-activation)
* [Theme wrapper](http://roots.io/an-introduction-to-the-roots-theme-wrapper/)
* Root relative URLs
* Cleaner HTML output of navigation menus
* Cleaner output of `wp_head` and enqueued scripts/styles
* Nice search (`/search/query/`)
* Image captions use `<figure>` and `<figcaption>`
* Example vCard widget
* Posts use the [hNews](http://microformats.org/wiki/hnews) microformat
* [Multilingual ready](http://roots.io/wpml/) (Brazilian Portuguese, Bulgarian, Catalan, Danish, Dutch, English, Finnish, French, German, Hungarian, Indonesian, Italian, Korean, Macedonian, Norwegian, Polish, Russian, Simplified Chinese, Spanish, Swedish, Traditional Chinese, Turkish, Vietnamese, Serbian)
1. Install `grunt-cli` globally with `npm install -g grunt-cli`.
2. Navigate to the theme directory, then run `npm install`. npm will look at `package.json` and automatically install the necessary dependencies. It will also automatically run `bower install`, which installs front-end packages defined in `bower.json`.

When completed, you'll be able to run the various Grunt commands provided from the command line.

### Available Grunt commands

* `grunt dev` — Compile LESS to CSS, concatenate and validate JS
* `grunt watch` — Compile assets when file changes are made
* `grunt build` — Create minified assets that are used on non-development environments

## Documentation

* [Roots 101](http://roots.io/roots-101/) — A guide to installing Roots, the files, and theme organization
* [Theme Wrapper](http://roots.io/an-introduction-to-the-roots-theme-wrapper/) — Learn all about the theme wrapper
* [Build Script](http://roots.io/using-grunt-for-wordpress-theme-development/) — A look into how Roots uses Grunt
* [Roots Sidebar](http://roots.io/the-roots-sidebar/) — Understand how to display or hide the sidebar in Roots

## Contributing

Expand Down
3 changes: 0 additions & 3 deletions assets/css/main.min.css

This file was deleted.

Empty file added assets/fonts/.gitkeep
Empty file.
Binary file removed assets/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
Loading

0 comments on commit 17716e5

Please sign in to comment.