Link to i18n content page from layout

Hi all. This is probably a follow-up of this question, but I couldn’t find anything fitting in the docs or the forum.

I’m trying to link from a layout file to a page that’s available in multiple languages. From what I took away in the Cross references docs, this works:

<a href="{{ relref . "" }}">Kontakt</a>

…which will only work for the default language, but not for e.g.

Are cross references even the correct approach if I just want a simple link to a content page from a layout file? :smile_cat:

I was figuring this out and came up with this solution:

<a href="{{ relref . "contact/" }}">Kontakt</a>

You also need to move your and to


Additionally if I understand ref and relref correctly the ref function should be used by default. The relref function is useful only in cases when the “relative” part is important. For example when the link will link to different pages when used in different sections.