fix: Remove basepath from docs

This commit is contained in:
Sidharth Vinod 2022-12-19 13:29:09 +05:30
parent 7670ada9ac
commit 8e7dd1d148
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
3 changed files with 6 additions and 4 deletions

View File

@ -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: {

View File

@ -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) {}
};

View File

@ -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');