Permalink
Browse files

Updated gruntfile; package.json; README; file structure; Added grunt …

…tasks; Fixed #8 language support
  • Loading branch information...
lacymorrow committed Apr 19, 2014
1 parent a1acf22 commit a055ce87343c88ae19ec503eff821b86944f36c0
View
@@ -11,6 +11,19 @@ Inspired by the [Ghost](http://ghost.org) blogging platform, Casper is a [WordPr
Download the [zip](https://github.com/lacymorrow/casper-wp/archive/master.zip) package of the theme and install either automatically through the WordPress Dashboard > Appearance tab, or by uploading the `casper-wp` folder to your WordPress/wp-content/themes directory.
#### Using Grunt to build the package
A `gruntfile.js` is included. `cd` into the theme directory and run `npm install` to install Grunt and all dependencies locally. Run `grunt` to build or `grunt watch` to continuously build.
###### Tasks
* Compile `src/css/style.less` and other LESS and CSS files in `src/css/`
* Any CSS is combed, linted, prefixed, then compiled with `css/style.css`
* `css/style.css` is minified into `style.css`
* Images in `src/img/` are compressed and copied to `img`
* Theme JavaScript and other js files in `src/js/` are linted, minified, and combined into `js/main.js`
## Getting Involved
Want to report a bug, request a feature, or help me build this project? The more the merrier!
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -85,12 +85,8 @@ function casper_widgets_init() {
*/
function casper_scripts() {
wp_enqueue_style('casper-google-fonts', '//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic|Open+Sans:700,400');
wp_enqueue_style( 'casper-style', get_template_directory_uri() . '/css/style.css' );
wp_enqueue_script( 'casper-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'casper-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'responsive-img', get_template_directory_uri() . '/js/responsive-img.js', array(), '1.0.0', true );
wp_enqueue_script( 'casper-index', get_template_directory_uri() . '/js/index.js', array('jquery'), '1.0.0', true );
wp_enqueue_style( 'casper-style', get_stylesheet_uri() );
wp_enqueue_script( 'casper-index', get_template_directory_uri() . '/js/main.js', array('jquery'), '1.0.0', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
View
@@ -1,52 +1,128 @@
module.exports = function(grunt) {
// 1. All configuration goes here
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*\n' +
' Theme Name: <%= pkg.name%>\n' +
' Theme URI: <%= pkg.homepage %>\n' +
' Author: <%= pkg.author %>\n' +
' Author URI: http://lacymorrow.com\n' +
' Description: <%= pkg.description %>\n' +
' Version: <%= pkg.version%>\n' +
' License: GNU General Public License\n' +
' License URI: license.txt\n' +
' Text Domain: casper\n' +
' Domain Path: /languages/\n' +
' Tags: responsive-layout, black, white, one-column, fluid-layout, custom-header, custom-menu, editor-style\n' +
' GitHub Theme URI: <%= pkg.repository.url %>\n' +
' GitHub Branch: master\n' +
' Casper is based on Underscores http://underscores.me/, (C) 2012-2014 Automattic, Inc.\n' +
' */',
autoprefixer: {
options: {
browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1', 'ie 9']
},
casper: {
expand: true,
flatten: true,
src: '<%= concat.casper.dest %>'
},
},
clean: {
casper: '<%= concat.casper.dest %>',
src: 'src/css/style.css'
},
concat: {
options: {
banner: '<%= banner %>\n',
stripBanners: true
},
casper: {
src: ['src/css/style.css', 'src/css/**/*.css'],
dest: 'css/style.css'
}
},
csscomb: {
casper: {
src: '<%= concat.casper.dest %>',
dest: '<%= concat.casper.dest %>'
}
},
csslint: {
src: [
'<%= concat.casper.dest %>'
]
},
cssmin: {
casper: {
options: {
banner: '<%= banner %>',
noAdvanced: true,
compatibility: 'ie8',
keepSpecialComments: 0
},
src: '<%= concat.casper.dest %>',
dest: 'style.css'
}
},
imagemin: {
dynamic: {
casper: {
files: [{
expand: true,
cwd: 'images/',
cwd: 'src/img/',
src: ['**/*.{png,jpg,gif}'],
dest: 'images/build/'
dest: 'img/'
}]
}
},
jshint: {
casper: ['gruntfile.js', 'src/js/**/*.js', 'js/**/*.js'],
options: {
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
less: {
standard: {
casper: {
options: {
compress: true,
yuicompress: true,
optimization: 2,
sourceMap: true
},
files: {
"css/style.css": "css/src/style.less"
"src/css/style.css": ["src/css/style.less", "src/css/**/*.less"]
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
casper: {
src: 'src/js/**/*.js',
dest: 'js/main.js'
}
},
watch: {
options: {
livereload: true,
},
styles: {
files: ['css/src/*.less'],
tasks: ['less'],
files: ['gruntfile.js', 'src/**/*'],
tasks: ['default'],
options: {
nospawn: true
}
},
}
});
// 3. Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
// 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
grunt.registerTask('default', ['watch']);
grunt.registerTask('js', [ /* 'jshint', */ 'uglify']);
grunt.registerTask('css', ['less', 'concat', 'csscomb', /* 'csslint', */ 'autoprefixer', 'cssmin']);
grunt.registerTask('default', ['clean', 'css', 'js', 'imagemin']);
};
View
Binary file not shown.
View
Binary file not shown.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,9 +1,34 @@
{
"name": "Casper",
"version": "0.1.0",
"version": "1.0.4",
"author": "Lacy Morrow <me@lacymorrow.com>",
"description": "A port of Ghost's Casper theme to WordPress",
"homepage": "https://github.com/lacymorrow/casper-wp",
"repository": {
"type": "git",
"url": "https://github.com/lacymorrow/casper-wp"
},
"devDependencies": {
"grunt": "~0.4.4",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-watch": "~0.6.1"
}
"grunt": "^0.4.4",
"grunt-contrib-csslint": "^0.2.0",
"grunt-contrib-cssmin": "^0.9.0",
"grunt-contrib-imagemin": "^0.6.1",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-less": "^0.11.0",
"grunt-contrib-uglify": "^0.4.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-csscomb": "^2.0.1",
"grunt-autoprefixer": "^0.7.2",
"load-grunt-tasks": "^0.4.0",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-concat": "^0.4.0"
},
"bugs": {
"url": "https://github.com/lacymorrow/casper-wp/issues"
},
"licenses": [
{
"type": "GPL"
}
]
}
File renamed without changes.
View

Large diffs are not rendered by default.

Oops, something went wrong.
File renamed without changes.
View
Binary file not shown.
View
Binary file not shown.
File renamed without changes.
@@ -1,5 +1,4 @@
/*global jQuery */
/*jshint multistr:true browser:true */
/* global jQuery */
/*!
* FitVids 1.0.3
*
File renamed without changes.
File renamed without changes.
File renamed without changes.
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit a055ce8

Please sign in to comment.