オンドレイ・Sevcik:
私はすでにチェックして、このソリューションを、それは私の問題のために動作するようには思えません。私は合格の問題を持っているpost.image
タグに変数名をresponsive_image
。私は、文字列を渡す場合はそのように{% responsive_image path: assets/img/ar-7.jpg %}
それはどんな問題なく動作しますが、私はどのように変数を渡す方法が見つかりませんでした。何か案は?
1)私は残念ながら、文字列は、これが機能するだろうと思ったpost.image
の代わりに変数を渡されます。コメントのコードは、私が対応する画像に変更する必要があることを例に取り組んでいます。
{% if post.image %}
{% responsive_image path: post.image %}
<!-- <img class="has-ratio" src="{{post.image}}" /> -->
{% endif %}
Invalid image path specified: "post.image"
Liquid Exception: unable to open image `/Users/.../Documents/Apps/Jekyll/wtc-mbp/post.image': No such file or directory @ error/blob.c/OpenBlob/2881 in .html
2)からソリューションこの答えは、仕事をしません
{% if post.image %}
{% assign path = post.image %}
{% responsive_image path %}
{% endif %}
Invalid image path specified: nil
Liquid Exception: no decode delegate for this image format `' @ error/constitute.c/ReadImage/566 in .html
3)もう一つのアイデアも仕事はしていません
{% if post.image %}
{% assign path = post.image %}
{% responsive_image path: path %}
{% endif %}
Invalid image path specified: "path"
Liquid Exception: unable to open image `/Users/.../Documents/Apps/Jekyll/wtc-mbp/path': No such file or directory @ error/blob.c/OpenBlob/2881 in .html
ashmaroli:
液体の変数を使用するには、を選ぶ必要があるresponsive_image_block
代わりにタグ:
{% responsive_image_block %}
path: {{ post.image }}
{% endresponsive_image_block %}