Add symlink for missing matz image for legworks #318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
「Rubyist のための他言語探訪」でmatzの画像がリンク切れになっているのを修正します。
Problem
「Rubyist のための他言語探訪」の一部のページでmatzの画像がリンク切れになっていました。 例: https://magazine.rubyist.net/articles/0022/0022-Legwork.html のページ下部など
それぞれリンク切れかどうかと、リンク先のsrcは次のようになっています。
../../images/0008-Legwork/elephant_at_hokudai.jpg
../../images/0009-Legwork/elephant_at_hokudai.jpg
../../images/0010-Legwork/elephant_at_hokudai.jpg
../../images/0011-Legwork/matz_in_suit.jpg
../../images/0013-Legwork/matz_in_suit.jpg
../../images/0014-Legwork/matz_in_suit.jpg
../../images/0015-Legwork/matz_in_suit.jpg
../../images/0017-Legwork/matz_in_suit.jpg
../../images/0018-Legwork/matz.jpg
../../images/0019-Legwork/matz.jpg
../../images/0021-Legwork/matz.jpg
../../images/0022-Legwork/matz.jpg
そして、どうやらこの結果を見ると、「同じ画像が続く時、その画像の初回登場以外」でリンク切れになっているようです。
たとえば第1回 Pythonの画像は
elephant_at_hokudai.jpg
ですが、これと同じ画像が出てくる第2回 CLU ではリンク切れになっています。そして、画像が
matz_in_suit.jpg
に変わった第4回 Tclでは画像が復活していますが、その次に同じ画像が使われている第6回ではまたリンク切れになっています。なお、軽くgitのログを見てみたところ、このリポジトリの最初のコミットの時点から、これらの画像は存在していなかったようでした。
Solution
存在しない画像を指しているものにたいして、同名の画像に向けたシンボリックリンクを作成します。
これによって画像が存在するようになるので、画像のリンク切れが改善します。
実際に
bundle exec jekyll serve -I --future
でサーバーを立ち上げて、各画像が表示されることを確認済みです。github pages でsymlink がうまく動くのか不安でしたが、ググって出てきたテストリポジトリを見る限りうまく動きそうに見えるので、大丈夫かなと思っています。
https://github.com/s4y/gh-pages-symlink-test