Why readFile can't find the file?

My problem arises with the following version:

Hugo Static Site Generator v0.48/extended linux/amd64 BuildDate: 2018-09-02T19:31:50+0200

I’m trying to render an SVG image into the page.

{{ with .Resources.GetMatch .Params.teaser }}
{{ readFile .RelPermalink | safeHTML }}
{{ end }}

It works fine for the default language, but it fails for any other language with the following error:

ERROR 2018/09/25 21:23:14 Error while rendering "home" in "": template: index.html:43:19: executing "main" at <readFile .RelPermali...>: error calling readFile: stat /home/user/workspace/content/en/offers/trainings/trainings.svg: no such file or directory

I just need to remove this language code from the URL somehow. I’ve tried to pipe the url to substr but it doesn’t work. Actually I don’t know how I can pipe something to substr.

{{ substr "/en/offers/engineering/engineering.svg" 3}} works fine
{{ .RelPermalink | substr 3 }} doesn’t work :frowning:

How can I inline a file which is next to a section?

Thank you in advance.

Just found an easy solution with: {{ print .Dir .Params.teaser | readFile | safeHTML }}