Markdown shortcode fails to render

Hello everyone!

I’m trying to rewrite my multiple photo sites in one single website with zola (and add a blog section, but that’s irrelevant).

In order to do so, i’ve created $ZOLA_ROOT/templates/shortcodes/gal_img.md with the following content:

[![{{path}}]({{ resize_image(path=path, width=1080, height=900, op="fit") }})]({{ path }})

A simple goal: make the given image a smaller display size to save on bandwidth, but include a link to the full-sized image on it.

It is valid markdown, as shown with this snippet: [![dog smiling](upload://gBWVIxKXcL1UVY9uN0s1969n3cc.jpeg)](https://i.imgur.com/cAS19H2.jpeg) rendering as this:

dog smiling

However, when trying to render the following markdown with zola serve, i’m given a quite obscure «failed to render content»:

+++
title = "My title"
description = "My description"
date = "2021-06-18"
+++
{{ gal_img(path="image_path_just_next_to_index_md.jpg") }}
Change detected @ 2021-06-18 11:34:06
-> Content changed $ZOLA_ROOT/content/photos/my_gallery/index.md
Failed to render content of $ZOLA_ROOT/content/photos/my_gallery/index.md
Done in 35ms.

Does this community see a mistake on my part? Is there a way for me to have more details as to what went wrong during rendering?

Thank you for reading, and thank you for this otherwise neat piece of software.

– Ololduck

Sorry if I got you wrong, but did you see an example from here: Image processing | Zola you may use {{ get_url(path=asset) }} to get a link to big image

Hello, @Roman!
Thank you for your answer, but the example given in your link only creates a serie of images, I like to add some comments to my pictures!

However, I solved my issue: after restarting zola serve, the full error appeared: Zola could not find the path to my image!

I’ve then rewritten my gal_img.md as gal_img.html containing the following:

{% set prefix = page.components | join(sep='/') %}
{% set fullpath = prefix ~ '/' ~ path %}

<a href="{{path}}" target="_blank">
  <img src="{{ resize_image(path=fullpath, width=1080, height=900, op="fit") }}"/>
</a>

that i use as such {{ gal_img(path="my_image_next_to_index.md.jpg") }}. It disables my editor’s preview of image files, but works enough for me, for now.

Thank you for your interest!

– Ololduck