Hugo pipe renders as text

I’m trying to test the image rendering functionality, but when I insert a hugo pipe in a post’s markdown file, it just displays the pipe as text.

For example, putting this in my post .md file:

test image:

{{ $image := Resources.Get "images/polaroid.png" }}

![polaroid test]($image)

Displays as this:

What am I doing wrong?

Related, is there a way to modify the markdown image tag (I assume via render-image.html) to always render images as webp? (either from the page bundle or from global assets)

Template code goes in template files.
Markdown goes in markdown files.

does that mean, in order to render unique images for a post, an individual template would need to be created for each post?


With this content structure:

└── posts/
    └── post-1/
        ├── a.jpg

Your markdown should be:

1 Like