Skip to content
Permalink
39a52d72a2
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 27 lines (20 sloc) 567 Bytes
#!/usr/bin/env ruby
require 'w3c_validators'
def validator(file)
extension = File.extname(file)
if extension == '.html'
W3CValidators::NuValidator.new
elsif extension == '.css'
W3CValidators::CSSValidator.new
end
end
def validate(file)
puts "Checking #{file}..."
path = File.expand_path "../_site/#{file}", __dir__
results = validator(file).validate_file(path)
return puts 'Valid!' if results.errors.empty?
results.errors.each { |err| puts err.to_s }
exit 1
end
validate 'index.html'
validate File.join 'assets', 'css', 'style.css'