mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
chore: Add docs to redirect.ts
This commit is contained in:
@@ -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];
|
||||||
|
Reference in New Issue
Block a user