hugo/docs/content/en/functions/relLangURL.md
2022-04-28 11:52:15 +02:00

973 B

title description date publishdate lastmod keywords categories menu signature workson hugoversion relatedfuncs deprecated aliases
relLangURL Adds the relative URL with correct language prefix according to site configuration for multilingual. 2017-02-01 2017-02-01 2017-02-01
multilingual
i18n
urls
functions
docs
parent
functions
relLangURL INPUT
false

absLangURL and relLangURL functions are similar to their absURL and relURL relatives but will add the correct language prefix when the site is configured with more than one language. (See Configure Languages.)

So for a site baseURL set to https://example.com/hugo/ and the current language is en:

{{ "blog/" | absLangURL }} → "https://example.com/hugo/en/blog/"
{{ "blog/" | relLangURL }} → "/hugo/en/blog/"