hugo/docs/content/en/methods/site/BaseURL.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

909 B

title description categories keywords action
BaseURL Returns the base URL as defined in the site configuration.
related returnType signatures
functions/urls/AbsURL
functions/urls/AbsLangURL
functions/urls/RelURL
functions/urls/RelLangURL
string
SITE.BaseURL

Site configuration:

{{< code-toggle file=hugo >}} baseURL = 'https://example.org/docs/' {{< /code-toggle >}}

Template:

{{ .Site.BaseURL }} → https://example.org/docs/

{{% note %}} There is almost never a good reason to use this method in your templates. Its usage tends to be fragile due to misconfiguration.

Use the absURL, absLangURL, relURL, or relLangURL functions instead.

{{% /note %}}