diff --git a/.travis.yml b/.travis.yml index b2ab4d3..45db7f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,24 @@ cache: bundler rvm: - 2.2.5 -#before_script: -# - chmod +x ./script/cibuild # or do this locally and commit +before_script: + - chmod +x ./script/cibuild # or do this locally and commit # Assume bundler is being used, therefore # the `install` step will run `bundle install` by default. -script: bundle exec jekyll build +script: ./script/cibuild # http://stackoverflow.com/questions/28611513/travis-build-failing-on-jekyll-project-cannot-find-jekyll # for html5proof ./script/cibuild && jekyll build && htmlproofer ./_site -sudo: required +sudo: false + +# branch whitelist, only for GitHub Pages +branches: + only: + - master + +env: + global: + - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer notifications: webhooks: @@ -20,3 +29,4 @@ notifications: on_success: always # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: false # default: false + diff --git a/Gemfile b/Gemfile index ec513b3..9739ef6 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,9 @@ gem "minima", "~> 2.0" # sitemap gem 'jekyll-sitemap' +# html-proofer for testing +gem 'html-proofer' + # If you want to use GitHub Pages, remove the "gem "jekyll"" above and # uncomment the line below. To upgrade, run `bundle update github-pages`. # gem "github-pages", group: :jekyll_plugins diff --git a/Gemfile.lock b/Gemfile.lock index 192bf88..245da5b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,30 @@ GEM remote: https://rubygems.org/ specs: + activesupport (5.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) addressable (2.5.0) public_suffix (~> 2.0, >= 2.0.2) colorator (1.1.0) + colored (1.2) + concurrent-ruby (1.0.4) + ethon (0.10.1) + ffi (>= 1.3.0) ffi (1.9.14) forwardable-extended (2.6.0) + html-proofer (3.4.0) + activesupport (>= 4.2, < 6.0) + addressable (~> 2.3) + colored (~> 1.2) + mercenary (~> 0.3.2) + nokogiri (~> 1.5) + parallel (~> 1.3) + typhoeus (~> 0.7) + yell (~> 2.0) + i18n (0.8.0) jekyll (3.3.0) addressable (~> 2.4) colorator (~> 1.0) @@ -31,8 +50,13 @@ GEM rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) mercenary (0.3.6) + mini_portile2 (2.1.0) minima (2.1.0) jekyll (~> 3.3) + minitest (5.10.1) + nokogiri (1.7.0.1) + mini_portile2 (~> 2.1.0) + parallel (1.10.0) pathutil (0.14.0) forwardable-extended (~> 2.6) public_suffix (2.0.4) @@ -42,11 +66,18 @@ GEM rouge (1.11.1) safe_yaml (1.0.4) sass (3.4.22) + thread_safe (0.3.5) + typhoeus (0.8.0) + ethon (>= 0.8.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + yell (2.0.7) PLATFORMS ruby DEPENDENCIES + html-proofer jekyll (= 3.3.0) jekyll-feed (~> 0.6) jekyll-sitemap diff --git a/_config.yml b/_config.yml index 24d6346..99e70f1 100644 --- a/_config.yml +++ b/_config.yml @@ -28,6 +28,7 @@ theme: minima gems: - jekyll-feed - jekyll-sitemap + - html-proofer sass: sass_dir: css/partials @@ -37,6 +38,8 @@ exclude: - Gemfile - Gemfile.lock - vendor + - misc + - script # Be sure to exclude vendor from your _config.yml # Travis bundles all gems in the vendor directory on its build servers, which Jekyll will mistakenly read and explode on. diff --git a/script/cibuild b/script/cibuild new file mode 100644 index 0000000..2f716f8 --- /dev/null +++ b/script/cibuild @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -e # halt script on error + +bundle exec jekyll build +bundle exec htmlproofer ./_site --allow-hash-href --check-favicon --check-opengraph --check-html \ No newline at end of file