From 261ac172b3a6a1aa927590ca34c73aeb00ed99cd Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Wed, 30 Dec 2015 14:20:24 -0500 Subject: [PATCH 01/27] Add initial version of Travis config --- .travis.yml | 14 ++++++++++++++ Gemfile | 1 + _config.yml | 2 +- cibuild.sh | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 cibuild.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..5896bacff --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: ruby +rvm: +- 2.1 + +before_script: + - chmod +x ./cibuild.sh # or do this locally and commit + +# Assume bundler is being used, therefore +# the `install` step will run `bundle install` by default. +script: ./cibuild.sh + +env: + global: + - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer \ No newline at end of file diff --git a/Gemfile b/Gemfile index 9c0465324..73c5a03d3 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,5 @@ source 'https://rubygems.org' gem 'github-pages' require 'rbconfig' +gem "html-proofer", :platforms => :ruby gem 'wdm', '~> 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i diff --git a/_config.yml b/_config.yml index deae3ee45..330ff5881 100644 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,6 @@ markdown: kramdown permalink: pretty -exclude: [README.md, Gemfile, Gemfile.lock, repo-metadata.html] +exclude: [README.md, Gemfile, Gemfile.lock, "repo-metadata.html", vendor, cibuild.sh, .travis.yml] gems: - jekyll-mentions diff --git a/cibuild.sh b/cibuild.sh new file mode 100644 index 000000000..6c2868104 --- /dev/null +++ b/cibuild.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -e # halt script on error + +echo "Searching for BOMs -------------------------------" + +FOUND_BOM=false +for filename in ./**/*.*; do + # Make sure that the file is UTF-8 so we don't search binary files or other encodings + CURRENT_FILE_ENCODING="`file --mime-encoding --brief "$filename"`" + if [ "$CURRENT_FILE_ENCODING" == "utf-8" ] && [ "`head -c 3 -- "$filename"`" == $'\xef\xbb\xbf' ] + then + # Make note of all the files that failed so we can see it in the Travis log + FOUND_BOM=true + echo "Found BOM in file $filename!" + fi +done + +if [ $FOUND_BOM == true ] +then + # We still want to run the other validation checks even if we found BOMs + echo "Checks failed! Jekyll can't handle BOMs. See above for list of problematic files." +fi + +echo "Building site ------------------------------------" +bundle exec jekyll build --trace + +echo "Validating HTML ----------------------------------" +bundle exec htmlproof ./_site --disable-external + +# If the site build succeeded but we found BOMs, we want to fail the build +if [ $FOUND_BOM == true ] +then + exit 1 +fi \ No newline at end of file From 434dd783aace5e2e2d90082836b6c4ce9520a084 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Wed, 30 Dec 2015 19:08:41 -0500 Subject: [PATCH 02/27] Fix easy issues with HTML compliance --- _includes/header.html | 6 +++--- _includes/screenshot.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_includes/header.html b/_includes/header.html index 7eea1ba6d..95158fa2c 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -8,7 +8,7 @@ - +