I have this shortcode:
<div class="cover-image">
<img src="{{ src }}"/>
<p class="desc">
{{ body }}
</p>
</div>
I am calling the shortcode like this:
{% cover(src="/posts/justice.jpg") %}
No light can compare with the light of justice.
{% end %}
I want to include image processing in it, so that I can automatically process images passed in, so something like this:
<div class="cover-image">
{% set image = resize_image(path=config.base_url ~ src, width=1200, height=700, op="fill", format="webp") %}
<img src="{{ image }}"/>
<p class="desc">
{{ body }}
</p>
</div>
Now I error with:
Error: Reason: Failed to render cover shortcode
Error: Reason: Failed to render 'shortcodes/cover.html'
Error: Reason: Function call 'resize_image' failed
Error: Reason: `resize_image`: Cannot find file: http://127.0.0.1:1111/posts/justice.jpg
However when I click the file, it loads right fine in the browser. Any idea how I can do this?