Skip to content

Instantly share code, notes, and snippets.

@branneman
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save branneman/ee46e2a16fb7c975441d to your computer and use it in GitHub Desktop.
Save branneman/ee46e2a16fb7c975441d to your computer and use it in GitHub Desktop.
Example `grunt-htmllint-http` setup when using http://frntndr.com/
'use strict';
var glob = require('glob');
module.exports = function Gruntfile(grunt) {
var config = grunt.file.readJSON('./app/config');
grunt.loadNpmTasks('grunt-htmllint-http');
grunt.initConfig({
'htmllint-http': {
options: {
ignore: [
'Bad value “X-UA-Compatible” for attribute “http-equiv” on XHTML element “meta”.',
'Bad value “apple-mobile-web-app-title” for attribute “name” on XHTML element “meta”: Keyword “apple-mobile-web-app-title” is not registered.'
]
},
dist: {
urls: (function() {
return glob.sync('src/**/*.html')
.map(function(file) {
return file.substr(3);
})
.filter(function(file) {
return !(
file.substr(0, 9) === '/modules/' ||
file.substr(0, 6) === '/docs/' ||
file.substr(0, 10) === '/includes/' ||
file.substr(0, 8) === '/layout/'
);
})
.map(function(file) {
return 'http://localhost:' + config.server.port + file;
});
}())
}
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment