relURL not always outputing URL


<div style="background-image: url('{{ "/img/principal.jpg" | relURL }}');">


<div style="background-image: url('/img/principal.jpg');">


<img src="{{ "/img/icon-form.png" | relURL }}">


<img src="../../img/icon-form.png">

The image is correct, the inline style is not.


relativeURLs: true
canonifyURLs: false
uglyurls: false

Why is this happening?

Thank you!


More information is needed to troubleshoot your issue. Please read Requesting Help and update your post. :slight_smile:


I’m running this on version 0.46

The weird thing is I’m getting this difference in behavior on the same partial.

This is a custom theme, but unfortunately I can’t really share it (intranet site).

Can you at least confirm that this is not the normal behavior? Meaning that the relURL output should have the same root.



Is your Hugo site published in a sub-directory of the intranet?