relLangURL.md (973B)
1 ---
2 title: relLangURL
3 description: Adds the relative URL with correct language prefix according to site configuration for multilingual.
4 date: 2017-02-01
5 publishdate: 2017-02-01
6 lastmod: 2017-02-01
7 keywords: [multilingual,i18n,urls]
8 categories: [functions]
9 menu:
10 docs:
11 parent: "functions"
12 signature: ["relLangURL INPUT"]
13 workson: []
14 hugoversion:
15 relatedfuncs: []
16 deprecated: false
17 aliases: []
18 ---
19
20 `absLangURL` and `relLangURL` functions are similar to their [`absURL`](/functions/absurl/) and [`relURL`](/functions/relurl/) relatives but will add the correct language prefix when the site is configured with more than one language. (See [Configure Languages][multiliconfig].)
21
22 So for a site `baseURL` set to `https://example.com/hugo/` and the current language is `en`:
23
24 ```
25 {{ "blog/" | absLangURL }} → "https://example.com/hugo/en/blog/"
26 {{ "blog/" | relLangURL }} → "/hugo/en/blog/"
27 ```
28
29 [multiliconfig]: /content-management/multilingual/#configure-languages