# Markdown shortcode fails to render

**URL:** <https://zola.discourse.group/t/markdown-shortcode-fails-to-render/947>\
**Category:** Support\
**Created:** [June 18, 2021, 9:44am UTC](https://zola.discourse.group/t/markdown-shortcode-fails-to-render/947 "2021-06-18T09:44:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oloduck](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/oloduck/32/534_2.png) [@oloduck](https://zola.discourse.group/u/oloduck)\
**Post date:** [June 18, 2021, 9:44am UTC](https://zola.discourse.group/t/markdown-shortcode-fails-to-render/947/1 "2021-06-18T09:44:52Z")

</div>

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:

```auto
[![{{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](https://global.discourse-cdn.com/free1/uploads/zola1/original/1X/746d018c0ebbef49fbf47348887fa3489ad685d8.jpeg)](https://i.imgur.com/cAS19H2.jpeg)

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

```auto
+++
title = "My title"
description = "My description"
date = "2021-06-18"
+++
{{ gal_img(path="image_path_just_next_to_index_md.jpg") }}

```

```auto
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

---

<div class="post-metadata">

**Author:** ![Roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@Roman](https://zola.discourse.group/u/Roman)\
**Post date:** [June 18, 2021, 5:16pm UTC](https://zola.discourse.group/t/markdown-shortcode-fails-to-render/947/2 "2021-06-18T17:16:10Z")

</div>

Sorry if I got you wrong, but did you see an example from here: [Image processing | Zola](https://www.getzola.org/documentation/content/image-processing/#creating-picture-galleries) you may use `{{ get_url(path=asset) }}` to get a link to big image

---

<div class="post-metadata">

**Author:** ![oloduck](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/oloduck/32/534_2.png) [@oloduck](https://zola.discourse.group/u/oloduck)\
**Post date:** [June 18, 2021, 9:04pm UTC](https://zola.discourse.group/t/markdown-shortcode-fails-to-render/947/3 "2021-06-18T21:04:26Z")

</div>

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:

```auto
{% 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
