mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 21:39:40 +02:00
Merge branch 'master' into develop
* master: Revert "Add CNAME" fix Redirect fix: Remove basepath from docs
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
mermaid.js.org
|
|
@@ -28,7 +28,7 @@
|
|||||||
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts",
|
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts",
|
||||||
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify",
|
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify",
|
||||||
"docs:pre:vitepress": "rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress",
|
"docs:pre:vitepress": "rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress",
|
||||||
"docs:build:vitepress": "pnpm docs:pre:vitepress && vitepress build src/vitepress && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing && cpy --flat src/docs/CNAME ./src/vitepress/.vitepress/dist/",
|
"docs:build:vitepress": "pnpm docs:pre:vitepress && vitepress build src/vitepress && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
|
||||||
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"vitepress dev src/vitepress\" \"ts-node-esm src/docs.mts --watch --vitepress\"",
|
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"vitepress dev src/vitepress\" \"ts-node-esm src/docs.mts --watch --vitepress\"",
|
||||||
"docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
|
"docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
|
||||||
"docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"",
|
"docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"",
|
||||||
|
@@ -14,9 +14,9 @@ export default defineConfig({
|
|||||||
lang: 'en-US',
|
lang: 'en-US',
|
||||||
title: 'Mermaid',
|
title: 'Mermaid',
|
||||||
description: 'Create diagrams and visualizations using text and code.',
|
description: 'Create diagrams and visualizations using text and code.',
|
||||||
base: '/mermaid/',
|
base: '/',
|
||||||
markdown: allMarkdownTransformers,
|
markdown: allMarkdownTransformers,
|
||||||
head: [['link', { rel: 'icon', type: 'image/x-icon', href: '/mermaid/favicon.ico' }]],
|
head: [['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]],
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
nav: nav(),
|
nav: nav(),
|
||||||
editLink: {
|
editLink: {
|
||||||
|
@@ -18,7 +18,7 @@ export default {
|
|||||||
if (newPath) {
|
if (newPath) {
|
||||||
console.log(`Redirecting to ${newPath} from ${window.location}`);
|
console.log(`Redirecting to ${newPath} from ${window.location}`);
|
||||||
// router.go isn't loading the ID properly.
|
// router.go isn't loading the ID properly.
|
||||||
window.location.href = `/mermaid/${newPath}`;
|
window.location.href = `/${newPath}`;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
};
|
};
|
||||||
|
@@ -8,6 +8,7 @@ test.each([
|
|||||||
['http://localhost:1234/mermaid/#/flowchart.md', 'syntax/flowchart.html'],
|
['http://localhost:1234/mermaid/#/flowchart.md', 'syntax/flowchart.html'],
|
||||||
['http://localhost/mermaid/#/flowchart.md', 'syntax/flowchart.html'],
|
['http://localhost/mermaid/#/flowchart.md', 'syntax/flowchart.html'],
|
||||||
['https://mermaid-js.github.io/mermaid/#/flowchart.md', 'syntax/flowchart.html'],
|
['https://mermaid-js.github.io/mermaid/#/flowchart.md', 'syntax/flowchart.html'],
|
||||||
|
['https://mermaid.js.org/#/flowchart.md', 'syntax/flowchart.html'],
|
||||||
['https://mermaid-js.github.io/mermaid/#/./flowchart', 'syntax/flowchart.html'],
|
['https://mermaid-js.github.io/mermaid/#/./flowchart', 'syntax/flowchart.html'],
|
||||||
['https://mermaid-js.github.io/mermaid/#/flowchart', 'syntax/flowchart.html'],
|
['https://mermaid-js.github.io/mermaid/#/flowchart', 'syntax/flowchart.html'],
|
||||||
['https://mermaid-js.github.io/mermaid/#flowchart', 'syntax/flowchart.html'],
|
['https://mermaid-js.github.io/mermaid/#flowchart', 'syntax/flowchart.html'],
|
||||||
@@ -31,7 +32,4 @@ test.each([
|
|||||||
test('should throw for invalid URL', () => {
|
test('should throw for invalid URL', () => {
|
||||||
// Not mermaid domain
|
// Not mermaid domain
|
||||||
expect(() => getRedirect('https://www.google.com')).toThrowError();
|
expect(() => getRedirect('https://www.google.com')).toThrowError();
|
||||||
|
|
||||||
// Not `/mermaid/` path
|
|
||||||
expect(() => getRedirect('http://localhost/#/flowchart.md')).toThrowError();
|
|
||||||
});
|
});
|
||||||
|
@@ -10,8 +10,9 @@ export interface Redirect {
|
|||||||
const getBaseFile = (link: string): Redirect => {
|
const getBaseFile = (link: string): Redirect => {
|
||||||
const url = new URL(link);
|
const url = new URL(link);
|
||||||
if (
|
if (
|
||||||
(url.hostname !== 'mermaid-js.github.io' && url.hostname !== 'localhost') ||
|
url.hostname !== 'mermaid-js.github.io' &&
|
||||||
url.pathname !== '/mermaid/'
|
url.hostname !== 'mermaid.js.org' &&
|
||||||
|
url.hostname !== 'localhost'
|
||||||
) {
|
) {
|
||||||
throw new Error('Not mermaidjs url');
|
throw new Error('Not mermaidjs url');
|
||||||
}
|
}
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
mermaid.js.org
|
|
Reference in New Issue
Block a user