hugo/content/en/functions/abslangurl.md
Bjørn Erik Pedersen b9bd35d72e Squashed 'docs/' content from commit fdea5430f
git-subtree-dir: docs
git-subtree-split: fdea5430f89dfd849d39212abdf5ace0a4763e5a
2019-10-21 10:22:28 +02:00

897 B

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

Both absLangURL and relLangURL 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.

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/"