From 94cf73e412eec656aceeb87d2e1920cb18c1d847 Mon Sep 17 00:00:00 2001 From: wuyangfan <1102042793@qq.com> Date: Sun, 17 May 2026 15:24:04 +0800 Subject: [PATCH] docs: clarify relative public_url usage --- guide/src/configuration/index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guide/src/configuration/index.md b/guide/src/configuration/index.md index 2284ee12..78032880 100644 --- a/guide/src/configuration/index.md +++ b/guide/src/configuration/index.md @@ -131,6 +131,15 @@ minify = "never" # Control minification: can be one of: never, on_rel no_sri = false # Allow disabling sub-resource integrity (SRI) ``` + +`public_url` may be an absolute path such as `/my-app/` or a relative path such as `./`. Use a relative value when the same build output can be served from different prefixes, for example GitLab Pages projects that may be hosted either at a project subpath or at a dedicated domain: + +```sh +trunk build --release --public-url='./' +``` + +The equivalent configuration value is `public_url = "./"` in the `[build]` section. + ## Watch section Trunk has built-in support for watching for source file changes, which triggers