Jekyllを1.5.1から2.3.0にアップデートした
私は会社のホームページや教育で使うテキストはJekyllを使って作っています。
最近ずっとアップデートしてなかったので、久しぶりにアップデートしてみました。使っていたのは 1.5.1 で現在の最新は 2.3.0 とメジャー・バージョンアップになるので少し不安でしたが、とくに問題なくアップデートできました。
アップデート手順
通常のRubyプログラムのアップデートと同じです。アップデートでJekillの生成するHTMLがおかしくなってないか確認するために現在の変換結果 _site/以下を保存しておき、アップデート後diffを見られるようにしたくらいです。
% mv _site _site.0 # 現バージョンの変換結果を保存 % mkdir _site % bundle update # Jekyllと関連するgemはbundleで管理しています (中身は jekyllとRedCloth) Fetching gem metadata from https://rubygems.org/........ Resolving dependencies... Using RedCloth 4.2.9 Using blankslate 2.1.2.4 ... Installing redcarpet 3.1.2 (was 2.3.0) Using safe_yaml 1.0.3 (was 1.0.1) Using parslet 1.5.0 Using toml 0.1.1 Installing jekyll 2.3.0 (was 1.5.1) Using bundler 1.6.2 Your bundle is updated! % rbenv rehash % jekyll -v jekyll 2.3.0 % jekyll server --watch --port 4000 # Jekyllを起動すると幾つかのワーニングが Configuration file: /Users/yy/Documents/jekyll-ey-office/_config.yml Deprecation: The 'pygments' configuration option has been renamed to 'highlighter'. Please update your config file accordingly. The allowed values are 'rouge', 'pygments' or null. Source: /Users/yy/Documents/jekyll-ey-office Destination: /Users/yy/Documents/jekyll-ey-office/_site Generating... Build Warning: Layout 'nil' requested in atom.xml does not exist. done. Auto-regeneration: enabled for '/Users/yy/Documents/jekyll-ey-office' Configuration file: /Users/yy/Documents/jekyll-ey-office/_config.yml Deprecation: The 'pygments' configuration option has been renamed to 'highlighter'. Please update your config file accordingly. The allowed values are 'rouge', 'pygments' or null. Server address: http://0.0.0.0:4000/ Server running... press ctrl-c to stop. %
ワーニングに対応
- _config.yml これはワーニングメッセージにある通り修正
-pygments: false +highlighter: :pygments
- atom.xml こちらは修正方法が GitHub issueにありました
-layout: nil +layout: null
レイアウト無しがの指定が nil から null に変更されたのですね (ナゼ^^;)
確認
RSSの作成日付が変わったのみで、生成されるHTMLはまったく同じでした!
% jekyll server --watch --port 4000 ... ^c % diff -r _site.0 _site diff -r _site.0/atom.xml _site/atom.xml 7c7 < <updated>2014-09-08T16:19:29+09:00</updated> --- > <updated>2014-09-08T17:32:18+09:00</updated>
独自の_plugin(マクロ)も使っていますが、問題ありませんでした。