alt and caption management: variables
borisschapira opened this issue · 3 comments
borisschapira commented
Alternative text and caption may be contained in variables, especially when used in a Jekyll include. Unfortunately, the following code does not work.
{% cloudinary include.path alt=include.alt caption=include.caption %}
A possible workaround:
{% cloudinary {{ include.path }} alt="{{ include.alt }}" caption="{{ include.caption }}" %}
nhoizey commented
I don't know if there's an easy way to know if the parameter is a simple string or an included variable.
I'll try to find something to enhance it and not require explicit variable syntax.
pascalwhoop commented
{% if post.lead_image_url %}
{% assign thumb_url = post.lead_image_url %}
{% cloudinary reading {{thumb_url}} alt="" %}
{% endif %}
how I use it.
nhoizey commented
I think recent documentation update answers this:
https://github.com/nhoizey/jekyll-cloudinary#liquid-tag-values