Jekyll のバックアップ(No.8)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- Jekyll へ行く。
- 1 (2014-09-28 (日) 01:54:33)
- 2 (2015-01-04 (日) 07:12:15)
- 3 (2015-02-02 (月) 17:31:05)
- 4 (2015-06-18 (木) 19:42:15)
- 5 (2016-01-27 (水) 18:49:04)
- 6 (2016-09-02 (金) 18:23:35)
- 7 (2017-04-04 (火) 20:26:00)
- 8 (2017-04-04 (火) 21:34:31)
- 9 (2018-06-01 (金) 14:21:26)
- 10 (2019-07-17 (水) 15:09:42)
- 11 (2025-01-03 (金) 08:57:02)
- 12 (2025-01-03 (金) 09:03:21)
- 13 (2025-01-03 (金) 09:04:02)
- keywords: [Jekyll, Ruby, Cygwin] description: Jekyllのインストール手順、エラーが発生した場合の修正方法、設定などのメモ author: aterai pubdate: 2014-09-28T01:50:02+09:00
概要
Windows + Cygwin64 + ruby 2.0.0の環境で、JekyllをインストールしMarkdown記法のテキストから静的サイトを生成します。
インストール
setup-x86_64.exeから、gcc-core、make、ruby、rubygems、ruby-devel、libffi-devel、openssh、openssl、gitをインストール~/.gemrcを作成--- gem: "--no-ri --no-rdoc --user-install" :benchmark: false :verbose: true :backtrace: true :update_sources: true :bulk_threshold: 1000 :sources: - http://gemcutter.org - http://gems.rubyforge.org/ - http://gems.github.com
gemでインストールgem install jekyll
tr: invalid byte sequence in UTF-8 (ArgumentError)とエラーになる場合- Cygwin - Ruby-1.9.3p327 - win32/registry - PIBを参考にして、
C:/cygwin64/usr/share/ruby/2.0.0/win32/registry.rbを修正# # Error # class Error < ::StandardError module Kernel32 extend Fiddle::Importer dlload "kernel32.dll" end # FormatMessageA = Kernel32.extern "int FormatMessageA(int, void *, int, int, void *, int, void *)", :stdcall # def initialize(code) # @code = code # msg = "\0".force_encoding(Encoding::ASCII_8BIT) * 1024 # len = FormatMessageA.call(0x1200, 0, code, 0, msg, 1024, 0) # msg = msg[0, len].force_encoding(Encoding.find(Encoding.locale_charmap)) # super msg.tr("\r", '').chomp # end FormatMessageW = Kernel32.extern "int FormatMessageW(int, void *, int, int, void *, int, void *)", :stdcall def initialize(code) @code = code msg = "\0\0".force_encoding(Encoding::UTF_16LE) * 1024 len = FormatMessageW.call(0x1200, 0, code, 0, msg, msg.size, 0) msg = msg[0, len].encode(Encoding.find(Encoding.locale_charmap)) super msg.tr("\r".encode(msg.encoding), '').chomp end attr_reader :code end
- Cygwin - Ruby-1.9.3p327 - win32/registry - PIBを参考にして、
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: -lcrypt が見つかりませんとエラーになる場合libcrypt-develをsetup-x86_64.exeからインストールしてgem install jekyllを再実行
Makefile:232: recipe for target 'ffi_c.so' failedとエラーになる場合- Problems compiling ffi 1.9.0 on cygwin 64bit ・ Issue #284 ・ ffi/ffi (via: make fails on Cygwin64bit ・ Issue #317 ・ ffi/ffi)などを参考に、
cygwin32-libffi、libffi-devel、pkg-configなどをsetup-x86_64.exeからインストールしてgem install jekyllを再実行export PKG_CONFIG_PATH="/lib/pkgconfig" gem install jekyll
- Problems compiling ffi 1.9.0 on cygwin 64bit ・ Issue #284 ・ ffi/ffi (via: make fails on Cygwin64bit ・ Issue #317 ・ ffi/ffi)などを参考に、
-lgmp が見つかりませんとエラーになる場合libgmp-develをsetup-x86_64.exeからインストールgcc -shared -o stemmer.so porter.o porter_wrap.o -L. -L/usr/lib -L. -fstack-protector -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import -lruby220 -lpthread -lgmp -ldl -lcrypt /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/bin/ld: -lgmp が見つかりません collect2: エラー: ld はステータス 1 で終了しました Makefile:254: ターゲット 'stemmer.so' のレシピで失敗しました make: *** [stemmer.so] エラー 1
Jekyll で google-code-prettify
- 参考: fnordig.de
パーサーをkramdownにして、行頭タブ(4スペース)ブロックの直後に{:class="prettyprint"}、または{:.prettyprint}を追加
def parse_pre(lines)
[%Q|#{lines.map {|line| "\t".concat(line) }.join("\n")}|, %Q|{:class="prettyprint"}|]
end
### サンプルコード
trayIcon.displayMessage("caption", "text", TrayIcon.MessageType.ERROR);
{:class="prettyprint"}
結果
<h3 id="section">サンプルコード</h3>
<pre class="prettyprint"><code>trayIcon.displayMessage("caption", "text", TrayIcon.MessageType.ERROR);
</code></pre>
default.htmlにprettify.js, prettify.cssを追加
<link href="{{ ASSET_PATH }}/css/prettify.css" type="text/css" rel="stylesheet" />
</head>
<body onload="prettyPrint()">
...
<script src="{{ ASSET_PATH }}/js/prettify.js"></script>
</body>
redcarpet
markdownのパーサーをredcarpetに変更
# _config.yml markdown: redcarpet redcarpet: renderer: Redcarpet::Render::XHTML extensions: ["xhtml", "fenced_code_blocks", "strikethrough", "no_intra_emphasis", "lax_spacing"]
no_intra_emphasis<pre><code>の中でも、アンダーライン(例:InputMap im = combobox.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);)が、<em>...</em>に変換されるので、no_intra_emphasisで回避