Last active
August 29, 2015 14:02
-
-
Save branneman/ee46e2a16fb7c975441d to your computer and use it in GitHub Desktop.
Example `grunt-htmllint-http` setup when using http://frntndr.com/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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