Render image hook and leaf bundles

resources.Get is a method which takes one argument: the filepath of the file relative to the asset directory and it does not apply to leaf bundles (unless you map the content directory as the assets directory).

GetMatch is a method to get page resources, it is the same as Match but it will return the first match.

The variable for a Markdown image ruled by a Markdown Render Hook Template is not called .src but .Destination, see the doc for reference.

Therefore I think that the above construct should be rewritten to something like:
.Page.Resources.GetMatch .Destination

Also have a look at this topic since it provides a more advanced example for rendering responsive images with Markdown Render Hooks.

2 Likes