docs: correct withBase description to say it prepends the base (#5339)

pull/5340/head
Lazizbek Ergashev 1 month ago committed by GitHub
parent 6629577b48
commit 83f22a4b7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -140,7 +140,7 @@ For custom themes, the same router is available from [`enhanceApp`](../guide/cus
- **Type**: `(path: string) => string` - **Type**: `(path: string) => string`
Appends the configured [`base`](./site-config#base) to a given URL path. Also see [Base URL](../guide/asset-handling#base-url). Prepends the configured [`base`](./site-config#base) to a given URL path. Also see [Base URL](../guide/asset-handling#base-url).
## `<Content />` <Badge type="info" text="component" /> ## `<Content />` <Badge type="info" text="component" />

@ -18,7 +18,7 @@ export function joinPath(base: string, path: string) {
} }
/** /**
* Append base to internal (non-relative) urls * Prepend base to internal (non-relative) urls
*/ */
export function withBase(path: string) { export function withBase(path: string) {
return EXTERNAL_URL_RE.test(path) || !path.startsWith('/') return EXTERNAL_URL_RE.test(path) || !path.startsWith('/')

Loading…
Cancel
Save