mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 03:12:35 +02:00
fix(v2): make client-redirect-plugin not baseUrl sensitive (#3010)
* feat(v2): use relative routes path in postBuild hook * feat(v2): use relativeRoutesPath in other methods and modify tests * fix(v2): fix D2 client redirects and tests * feat(v2): add tests for relativeRoutesPaths * fix(v2): fix some typos in configValidation * fix(v2): fix an eslint warning and restart github action * refactor(v2): create a removePrefix method * refactor(v2): inline unnecessary method
This commit is contained in:
parent
b58a53eae8
commit
2e055f4ae2
10 changed files with 81 additions and 71 deletions
|
@ -384,6 +384,10 @@ export function removeSuffix(str: string, suffix: string): string {
|
|||
return str.endsWith(suffix) ? str.slice(0, -suffix.length) : str;
|
||||
}
|
||||
|
||||
export function removePrefix(str: string, prefix: string): string {
|
||||
return str.startsWith(prefix) ? str.slice(prefix.length) : str;
|
||||
}
|
||||
|
||||
export function getFilePathForRoutePath(routePath: string): string {
|
||||
const fileName = path.basename(routePath);
|
||||
const filePath = path.dirname(routePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue