Using shortcodes on GitLabs

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

config.toml

    DefaultContentLanguage = "de"
    baseURL = "https://xxxxxx.gitlab.io/hugo"

_index.md
{{< figure src="images/85-1.jpg" title="a-title" alt="some-text" >}}

_index.en.md
{{< figure src="images/85-1.jpg" title="a-title" alt="some_text" >}}

On the german site the browser will find my image in "https://xxxxxx.gitlab.io/hugo/images/…"
On the english site the browser is searching in “https://xxxxxx.gitlab.io/hugo/en/images/…”

Do i have to manually point in my _index.en.md 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