docs: fix cross-project links to use base path in production (#8160)
This commit is contained in:
1 parent
b1964a0384
commit
0aac0f8bac
6 files changed
+25
-49
No files matched your search
@@ -18,7 +18,7 @@ const PROJECT_REGEX = /^!(?<area>[\w-]+)!/
|
||||
|
||||
function matchAndFixLinks(
|
||||
link: string,
|
||||
{ baseUrl, projectUrls }: CrossProjectLinksOptions
|
||||
{ baseUrl, projectUrls, useBaseUrl = false }: CrossProjectLinksOptions
|
||||
): string {
|
||||
const projectArea = PROJECT_REGEX.exec(link)
|
||||
|
||||
@@ -29,6 +29,7 @@ function matchAndFixLinks(
|
||||
const actualUrl = link.replace(PROJECT_REGEX, "")
|
||||
|
||||
const base =
|
||||
!useBaseUrl &&
|
||||
projectUrls &&
|
||||
Object.hasOwn(projectUrls, projectArea.groups.area) &&
|
||||
projectUrls[projectArea.groups.area]?.url
|
||||
|
||||
@@ -115,6 +115,7 @@ export declare type CrossProjectLinksOptions = {
|
||||
path?: string
|
||||
}
|
||||
}
|
||||
useBaseUrl?: boolean
|
||||
}
|
||||
|
||||
export declare type TypeListLinkFixerOptions = {
|
||||
|
||||
Reference in new issue
Block a user