Getting an image url

Hi All,

I need your help on concating permalink with the image file name to use it for image source.

I have this code

{{ $f := “post.jpg”}}

{{ postimage := (print .RelPermalink $f ) }}
<a href="{{ .RelPermalink }}" {{ $target | safeHTMLAttr }}>

.RelPermalink --> It gives me the URL of the page perfectly

However, the .RelPermalink+post.jp for displaying in the image source. I want the image source url as pagerul/post.jpg.

If the file post.jpg is relative to the page, you can access it with Page Resources.

I encourage you to check out the Page Resources documentation: