When I use the {{ site.url }} tag for the image path inside the variable in the front question, it does not translate to HTML.
The following works fine:
--- layout: post title: chickpea img: <img class="caption__media" data-interchange="[../asset/img/chickpea-small.jpg (small)], [../asset/img/chickpea-medium.jpg, (medium)], [../asset/img/chickpea-large.jpg, (large)]"> ---
This does not work:
--- layout: post title: chickpea img: <img class="caption__media" data-interchange="[{{site.url}}/asset/img/chickpea-small.jpg (small)], [{{site.url}}/asset/img/chickpea-medium.jpg, (medium)], [{{site.url}}/asset/img/chickpea-large.jpg, (large)]"> ---
But when I use the same image link with the {{site.url}} tag inside the message, and not as a variable, it works.
Analysis of the created site shows that Jekyll does not convert the {{site.url}} tag when I use it in the image variable defined in the front question.
So the question is: how can I get Jekyll to correctly translate the image path into the front YAML field?
source share