Skip to content

Instantly share code, notes, and snippets.

@branneman branneman/gruntfile.js
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.