diff --git a/Gruntfile.js b/Gruntfile.js index c4e997c..2987ff0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -250,7 +250,34 @@ module.exports = function (grunt) { }, jekyll: { - docs: {} + options: { + config: '_config.yml' + }, + docs: {}, + github: { + options: { + raw: 'github: true' + } + } + }, + + htmlmin: { + dist: { + options: { + collapseWhitespace: true, + conservativeCollapse: true, + minifyCSS: true, + minifyJS: true, + removeAttributeQuotes: true, + removeComments: true + }, + expand: true, + cwd: '_site', + dest: '_site', + src: [ + '**/*.html' + ] + } }, jshint: { @@ -337,6 +364,25 @@ module.exports = function (grunt) { port: 8000 } } + }, + + compress: { + main: { + options: { + archive: 'ratchet-<%= pkg.version %>-dist.zip', + mode: 'zip', + level: 9, + pretty: true + }, + files: [ + { + expand: true, + cwd: 'dist/', + src: ['**'], + dest: 'ratchet-<%= pkg.version %>-dist' + } + ] + } } }); @@ -353,6 +399,7 @@ module.exports = function (grunt) { grunt.registerTask('default', ['dist']); grunt.registerTask('test', ['dist', 'csslint', 'jshint', 'jscs', 'validate-html']); grunt.registerTask('server', ['dist', 'jekyll', 'connect', 'watch']); + grunt.registerTask('prep-release', ['dist', 'jekyll:github', 'htmlmin', 'compress']); grunt.registerTask('build-ratchicons-data', generateRatchiconsData); diff --git a/package.json b/package.json index a359b47..607bcf4 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,13 @@ "grunt-autoprefixer": "~3.0.0", "grunt-banner": "~0.3.1", "grunt-contrib-clean": "~0.6.0", + "grunt-contrib-compress": "~0.13.0", "grunt-contrib-concat": "~0.5.1", "grunt-contrib-connect": "~0.10.1", "grunt-contrib-copy": "~0.8.0", "grunt-contrib-csslint": "~0.4.0", "grunt-contrib-cssmin": "~0.12.2", + "grunt-contrib-htmlmin": "~0.4.0", "grunt-contrib-jshint": "~0.11.2", "grunt-contrib-sass": "~0.9.2", "grunt-contrib-uglify": "~0.9.1",