hugo

Fork of github.com/gohugoio/hugo with reverse pagination support

git clone git://git.shimmy1996.com/hugo.git

abslangurl.md (887B)

    1 ---
    2 title: absLangURL
    3 description: Adds the absolute 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 categories: [functions]
    8 menu:
    9   docs:
   10     parent: "functions"
   11 keywords: [multilingual,i18n,urls]
   12 signature: ["absLangURL INPUT"]
   13 workson: []
   14 hugoversion:
   15 relatedfuncs: [relLangURL]
   16 deprecated: false
   17 aliases: []
   18 ---
   19 
   20 Both `absLangURL` and [`relLangURL`](/functions/rellangurl/) 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.
   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 ```