mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-08 05:42:34 +02:00
fix(v2): redirect plugin: use siteConfig.trailingSlash (#4988)
This commit is contained in:
parent
80b6d9728e
commit
b54ec72389
15 changed files with 443 additions and 73 deletions
|
@ -27,6 +27,7 @@ import {docuHash} from './docuHash';
|
|||
|
||||
export const posixPath = posixPathImport;
|
||||
|
||||
export * from './getFilePathForRoutePath';
|
||||
export * from './codeTranslationsUtils';
|
||||
export * from './markdownParser';
|
||||
export * from './markdownLinks';
|
||||
|
@ -325,12 +326,6 @@ 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);
|
||||
return path.join(filePath, `${fileName}/index.html`);
|
||||
}
|
||||
|
||||
export function getElementsAround<T extends unknown>(
|
||||
array: T[],
|
||||
aroundIndex: number,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue