From ca7b97134dc32282b8714cb3d0ac41b955df76ca Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Sun, 12 Apr 2015 08:14:32 -0400 Subject: [PATCH] Backend: Upgrade To Jekyll 1.3.0 & Remove Workarounds * Require in Makefile that everyone use bundle to remove inconsistencies * Require in Gemfile that everyone use Jekyll 1.3.* * Require in Gemfile that everyone use Ruby 2.0.0 (already used by Travis and most developers) * Remove workaround _plugin/svg.rb which showed SVG files in `jekyll serve` (fixed in Jekyll 1.0.0) * Remove inconsistent file path workarounds in _plugins/autocrossref.rb and _plugins/inline-template.rb --- Gemfile | 9 +++++++-- Gemfile.lock | 2 +- Makefile | 9 +-------- _plugins/autocrossref.rb | 4 +--- _plugins/inline-template.rb | 5 +---- _plugins/svg.rb | 10 ---------- 6 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 _plugins/svg.rb diff --git a/Gemfile b/Gemfile index b179acc5..89bcc438 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,15 @@ source 'https://rubygems.org' -#ruby '2.0.0' +## If you update the version here, also update it in .travis.yml and +## README.md. Then push your branch and make sure Travis supports that +## version. Then remind one of the site maintainers that they need to +## run `rvm install ` on the build server(s) before they commit +## to master +ruby '2.0.0' group :development do gem 'ffi-icu' - gem 'jekyll' + gem 'jekyll', '~>1.3.0' gem 'json' gem 'less' gem 'kramdown' diff --git a/Gemfile.lock b/Gemfile.lock index 09a97f6e..e8c662c6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,7 +80,7 @@ DEPENDENCIES RedCloth ffi-icu html-proofer - jekyll + jekyll (~> 1.3.0) json kramdown less diff --git a/Makefile b/Makefile index ba551c76..d5433374 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,6 @@ S=@ ## Silent: only print errors by default; ## run `make S='' [other args]` to print commands as they're run -## Old versions of jekyll must not call "build". If you have one of -## these versions, either run make like this: make JEKYLL_COMMAND=jekyll -## or create the JEKYLL_COMMAND environmental variable: -# echo 'export JEKYLL_COMMAND=jekyll' >> ~/.bashrc -# exec bash -# make -JEKYLL_COMMAND ?= "bundle exec jekyll build" SITEDIR=_site JEKYLL_LOG=._jekyll.log @@ -74,7 +67,7 @@ ERROR_ON_OUTPUT="sed '1s/^/ERROR:\n/' | if grep . ; then sed 1iERROR ; false ; e ## Always build using the default locale so log messages can be grepped. ## This should not affect webpage output. build: - $S export LANG=C.UTF-8 ; eval $(JEKYLL_COMMAND) 2>&1 | tee $(JEKYLL_LOG) + $S export LANG=C.UTF-8 ; bundle exec jekyll build 2>&1 | tee $(JEKYLL_LOG) $S grep -r -L 'Note: this file is built non-deterministically' _site/ \ | egrep -v 'sha256sums.txt' \ | xargs sha256sum > _site/sha256sums.txt diff --git a/_plugins/autocrossref.rb b/_plugins/autocrossref.rb index 7401ab9e..f19b1a0f 100644 --- a/_plugins/autocrossref.rb +++ b/_plugins/autocrossref.rb @@ -33,12 +33,10 @@ require 'yaml' def render(context) output = super - ## Workaround for inconsistent relative directory - path = File.expand_path(File.dirname(__FILE__)) + "/.." ## Load terms from file site = context.registers[:site].config if !site.has_key?("crossref") - site['crossref'] = YAML.load_file(path + "/_autocrossref.yaml") + site['crossref'] = YAML.load_file("_autocrossref.yaml") end ## Sort terms by reverse length, so longest matches get linked diff --git a/_plugins/inline-template.rb b/_plugins/inline-template.rb index 36bfebbb..9de86591 100644 --- a/_plugins/inline-template.rb +++ b/_plugins/inline-template.rb @@ -23,11 +23,8 @@ require 'yaml' def render(context) output = super - ## Workaround for inconsistent relative directory - path = File.expand_path(File.dirname(__FILE__)) + "/../" - data = YAML.load(output) - template = File.open(path + @template_name, mode="r") + template = File.open(@template_name, mode="r") @mytemplate = Liquid::Template.parse(template.read()) @mytemplate.render('entry' => data) end diff --git a/_plugins/svg.rb b/_plugins/svg.rb deleted file mode 100644 index 62e4a753..00000000 --- a/_plugins/svg.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This file is licensed under the MIT License (MIT) available on -# http://opensource.org/licenses/MIT. - -#svg.rb is a workaround to allow built-in jekyll server -#to serve svg files with jekyll --server. - -require 'webrick' -include WEBrick - -WEBrick::HTTPUtils::DefaultMimeTypes.store 'svg', 'image/svg+xml'