Markdown image hooks and markdownify

Hi, I’m trying to custom image hook, but cannot access the page resources when using markdownify inside a shortcode.

// layouts/_default/_markup/render-image.html
{{ warnf "%s" .Page.Resources }}
{{ with .Page.Resources.GetMatch .Destination }}
    <img src="{{ .RelPermalink }}" />
{{ end }}


// layouts/shortcodes/clearfix.html
<div class="clearfix">
    {{ .Inner | markdownify }}
</div>
## Image inside content

![](featured.jpg)

## Image inside shortcode

{{< clearfix >}}
![](featured.jpg)
{{< /clearfix >}}

Log messages as follows.

WARN 2023/01/30 09:50:08 []
WARN 2023/01/30 09:50:08 [featured.jpg]

I don’t know if it’s a limitation of markdownify or should be considered as a bug?

markdown (need to fully render the shortcode)

{{% clearfix %}}
![](featured.jpg)
{{% /clearfix %}}

shortcode

<div class="clearfix">
  {{ .Inner }}
</div>
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.