mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
fix: Remove basepath from docs
This commit is contained in:
@@ -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) {}
|
||||||
};
|
};
|
||||||
|
@@ -10,7 +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.hostname !== 'mermaid.js.org' &&
|
||||||
|
url.hostname !== 'localhost') ||
|
||||||
url.pathname !== '/mermaid/'
|
url.pathname !== '/mermaid/'
|
||||||
) {
|
) {
|
||||||
throw new Error('Not mermaidjs url');
|
throw new Error('Not mermaidjs url');
|
||||||
|
Reference in New Issue
Block a user