fix: Remove basepath from docs
This commit is contained in:
parent
7670ada9ac
commit
8e7dd1d148
|
@ -14,9 +14,9 @@ export default defineConfig({
|
|||
lang: 'en-US',
|
||||
title: 'Mermaid',
|
||||
description: 'Create diagrams and visualizations using text and code.',
|
||||
base: '/mermaid/',
|
||||
base: '/',
|
||||
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: {
|
||||
nav: nav(),
|
||||
editLink: {
|
||||
|
|
|
@ -18,7 +18,7 @@ export default {
|
|||
if (newPath) {
|
||||
console.log(`Redirecting to ${newPath} from ${window.location}`);
|
||||
// router.go isn't loading the ID properly.
|
||||
window.location.href = `/mermaid/${newPath}`;
|
||||
window.location.href = `/${newPath}`;
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
|
|
|
@ -10,7 +10,9 @@ export interface Redirect {
|
|||
const getBaseFile = (link: string): Redirect => {
|
||||
const url = new URL(link);
|
||||
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/'
|
||||
) {
|
||||
throw new Error('Not mermaidjs url');
|
||||
|
|
Loading…
Reference in New Issue