Using shortcodes on GitLabs

i have an multilingual site and i use GitLab.
So here my problem/setup :slight_smile:


    DefaultContentLanguage = "de"
    baseURL = ""
{{< figure src="images/85-1.jpg" title="a-title" alt="some-text" >}}
{{< figure src="images/85-1.jpg" title="a-title" alt="some_text" >}}

On the german site the browser will find my image in "…"
On the english site the browser is searching in “…”

Do i have to manually point in my file to the specific folder? like so:
{{< figure src="../images/85-1.jpg" title="a-title" alt="some_text" >}}
or is there a trick for the shortcode?

If i delete the subcategory “hugo” in my config.toml i can just use
{{< figure src="/images/85-1.jpg" title="a-title" alt="some_text" >}}
and the browser finds the picture becaus of the root-directory. But i want to publish/push my site to GitLab and i need the baseURL with the subfolder.

hope you understand my problem (english is not my first language :slight_smile: )

adding this in my config.toml makes the trick:
relativeURLS = true

and now my shortcodes can look like these
{{< figure src="/images/85-1.jpg" title="a-title" alt="some_text" >}}
and everything works perfect.

i love HUGO :heart_eyes:

1 Like