BaseURL
返回站點配置中定義的基礎 URL。
Syntax
SITE.BaseURL
Returns
string
站點配置:
baseURL: https://example.org/docs/
baseURL = 'https://example.org/docs/'
{
"baseURL": "https://example.org/docs/"
}
模板:
{{ .Site.BaseURL }} → https://example.org/docs/幾乎從來沒有好的理由在模板中使用此方法。由於其用法往往因配置錯誤而脆弱。
請改用 absURL、absLangURL、relURL 或 relLangURL 函數。