From 328a7684fa4fbcb12ae0af43d028b9f115653c88 Mon Sep 17 00:00:00 2001 From: m5o Date: Tue, 20 Aug 2013 11:55:22 +0200 Subject: [PATCH] update organization files to latest 3.0.0 --- .travis.yml | 1 + Gruntfile.js | 54 ++++++++++++++++++++++++++++++++++++++++++++------- README.md | 2 ++ bower.json | 2 +- composer.json | 14 ++++++++++++- package.json | 5 ++++- 6 files changed, 68 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5ed6e43e67d4..9f2371887fa0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: node_js node_js: - 0.8 before_script: + - gem install jekyll - npm install -g grunt-cli env: global: diff --git a/Gruntfile.js b/Gruntfile.js index c15b4ad11530..cfefae2cddd4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -83,6 +83,25 @@ module.exports = function(grunt) { }, src: ['less/bootstrap.less'], dest: 'dist/css/<%= pkg.name %>.min.css' + }, + theme: { + src: ['less/theme.less'], + dest: 'dist/css/<%= pkg.name %>-theme.css' + }, + theme_min: { + options: { + compress: true + }, + src: ['less/theme.less'], + dest: 'dist/css/<%= pkg.name %>-theme.min.css' + } + }, + + copy: { + fonts: { + expand: true, + src: ["fonts/*"], + dest: 'dist/' } }, @@ -102,6 +121,19 @@ module.exports = function(grunt) { } }, + jekyll: { + docs: {} + }, + + validation: { + options: { + reset: true + }, + files: { + src: ["_gh_pages/**/*.html"] + } + }, + watch: { src: { files: '<%= jshint.src.src %>', @@ -123,16 +155,21 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-html-validation'); + grunt.loadNpmTasks('grunt-jekyll'); grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('browserstack-runner'); + // Docs HTML validation task + grunt.registerTask('validate-html', ['jekyll', 'validation']); // Test task. - var testSubtasks = ['jshint', 'qunit']; + var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html']; // Only run BrowserStack tests under Travis if (process.env.TRAVIS) { // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key @@ -148,11 +185,14 @@ module.exports = function(grunt) { // CSS distribution task. grunt.registerTask('dist-css', ['recess']); + // Fonts distribution task. + grunt.registerTask('dist-fonts', ['copy']); + // Full distribution task. - grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js']); + grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']); // Default task. - grunt.registerTask('default', ['test', 'dist']); + grunt.registerTask('default', ['test', 'dist', 'build-customizer']); // task for building customizer grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () { @@ -162,7 +202,7 @@ module.exports = function(grunt) { var files = {} fs.readdirSync(type) .filter(function (path) { - return new RegExp('\\.' + type + '$').test(path) + return type == 'fonts' ? true : new RegExp('\\.' + type + '$').test(path) }) .forEach(function (path) { return files[path] = fs.readFileSync(type + '/' + path, 'utf8') @@ -171,7 +211,7 @@ module.exports = function(grunt) { } var customize = fs.readFileSync('customize.html', 'utf-8') - var files = '\n