Back to Hugo

BaseURL

docs/content/en/methods/site/BaseURL.md

0.161.1590 B
Original Source

Project configuration:

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

Template:

go-html-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.