From 06d1c5d4596f77b1620e2b3f6abdb0ac189f2e7c Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 25 Feb 2014 16:47:49 -0800 Subject: [PATCH] import HTML5 validation task from Bootstrap; fixes #282 --- .gitignore | 4 ++++ Gruntfile.js | 21 +++++++++++++++++++++ package.json | 1 + 3 files changed, 26 insertions(+) diff --git a/.gitignore b/.gitignore index 9436b70..624bc2d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,7 @@ nbproject .idea node_modules _site + +# grunt-html-validation +validation-report.json +validation-status.json diff --git a/Gruntfile.js b/Gruntfile.js index 5a3ee70..9b6849d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -118,6 +118,26 @@ module.exports = function(grunt) { ], tasks: ['sass'] } + }, + + jekyll: { + docs: {} + }, + + validation: { + options: { + charset: 'utf-8', + doctype: 'HTML5', + failHard: true, + reset: true, + relaxerror: [ + 'Bad value apple-mobile-web-app-title for attribute name on element meta: Keyword apple-mobile-web-app-title is not registered.', + 'Attribute ontouchstart not allowed on element body at this point.' + ] + }, + files: { + src: '_site/**/*.html' + } } }); @@ -129,6 +149,7 @@ module.exports = function(grunt) { grunt.registerTask('dist-css', ['sass', 'cssmin']); grunt.registerTask('dist-js', ['concat', 'uglify']); grunt.registerTask('dist', ['dist-css', 'dist-js', 'banner', 'copy']); + grunt.registerTask('validate-html', ['jekyll', 'validation']); grunt.registerTask('default', ['dist']); grunt.registerTask('build', ['dist']); }; diff --git a/package.json b/package.json index 3ec0610..b0fc230 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "grunt-contrib-sass": "~0.7.1", "grunt-contrib-uglify": "~0.3.0", "grunt-contrib-watch": "~0.5.3", + "grunt-html-validation": "~0.1.13", "grunt-jekyll": "~0.4.1", "load-grunt-tasks": "~0.4.0" }