Fixed redirects inside vitepress, extended tests

This commit is contained in:
Nikolay Rozhkov 2023-08-25 12:35:07 +03:00
parent 58afdd1baa
commit 2676130146
2 changed files with 11 additions and 4 deletions

View File

@ -21,6 +21,13 @@ test.each([
],
['https://mermaid-js.github.io/mermaid/#/n00b-advanced', 'config/advanced.html'], // without .md
['https://mermaid-js.github.io/mermaid/#/n00b-advanced.md', 'config/advanced.html'], // with .md
['https://mermaid-js.github.io/mermaid/#/n00b-gettingstarted', 'intro/getting-started.html'],
['https://mermaid-js.github.io/mermaid/#/n00b-gettingstarted.md', 'intro/getting-started.html'],
['https://mermaid-js.github.io/mermaid/#/n00b-overview', 'intro/getting-started.html'],
['https://mermaid-js.github.io/mermaid/#/n00b-overview.md', 'intro/getting-started.html'],
['https://mermaid-js.github.io/mermaid/#/n00b-syntaxreference', 'intro/syntax-reference.html'],
['https://mermaid-js.github.io/mermaid/#/n00b-syntaxreference.md', 'intro/syntax-reference.html'],
[
'https://mermaid-js.github.io/mermaid/#/flowchart?id=a-node-in-the-form-of-a-circle', // with id, without .md
'syntax/flowchart.html#a-node-in-the-form-of-a-circle',

View File

@ -51,13 +51,9 @@ const idRedirectMap: Record<string, string> = {
mindmap: 'syntax/mindmap',
'more-pages': '',
'n00b-advanced': 'config/advanced',
'config/n00b-advanced': 'config/advanced',
'n00b-gettingstarted': 'intro/getting-started',
'intro/n00b-gettingStarted': 'intro/getting-started',
'n00b-overview': 'intro/getting-started',
'n00b-syntaxreference': 'intro/syntax-reference',
'intro/n00b-syntaxReference': 'intro/syntax-reference',
'community/n00b-overview': 'intro/getting-started',
newdiagram: 'community/newDiagram',
pie: 'syntax/pie',
plugins: '',
@ -81,6 +77,10 @@ const idRedirectMap: Record<string, string> = {
const urlRedirectMap: Record<string, string> = {
'/misc/faq.html': 'configure/faq.html',
'/syntax/c4c.html': 'syntax/c4.html',
'/config/n00b-advanced.html': 'config/advanced',
'/intro/n00b-gettingStarted.html': 'intro/getting-started',
'/intro/n00b-syntaxReference.html': 'intro/syntax-reference',
'/community/n00b-overview.html': 'intro/getting-started',
};
/**