mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
chore: Add docs to redirect.ts
This commit is contained in:
parent
82f63b056f
commit
18c27c6f1d
@ -1,3 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Extracts the base slug from the old URL.
|
||||||
|
* @param link - The old URL.
|
||||||
|
*/
|
||||||
export const getBaseFile = (link: string): string => {
|
export const getBaseFile = (link: string): string => {
|
||||||
const url = new URL(link);
|
const url = new URL(link);
|
||||||
if (
|
if (
|
||||||
@ -59,6 +63,11 @@ const redirectMap: Record<string, string> = {
|
|||||||
'user-journey': 'syntax/userJourney',
|
'user-journey': 'syntax/userJourney',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param link - The old documentation URL.
|
||||||
|
* @returns The new documentation path.
|
||||||
|
*/
|
||||||
export const getRedirect = (link: string): string | undefined => {
|
export const getRedirect = (link: string): string | undefined => {
|
||||||
const base = getBaseFile(link);
|
const base = getBaseFile(link);
|
||||||
return redirectMap[base];
|
return redirectMap[base];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user