diff --git a/docs/src/.vitepress/config.mts b/docs/src/.vitepress/config.mts index f40210f2..2bc6584f 100644 --- a/docs/src/.vitepress/config.mts +++ b/docs/src/.vitepress/config.mts @@ -5,8 +5,7 @@ import footnote from "markdown-it-footnote"; import { transformerMetaWordHighlight } from '@shikijs/transformers'; function getBaseRepository(base: string): string { - if (!base) return '/'; - // I guess if deploy_url is available. From where do I check this ? + if (!base || base === '/') return '/'; const parts = base.split('/').filter(Boolean); return parts.length > 0 ? `/${parts[0]}/` : '/'; } diff --git a/docs/src/.vitepress/theme/VersionPicker.vue b/docs/src/.vitepress/theme/VersionPicker.vue index b6505402..d0f8f65e 100644 --- a/docs/src/.vitepress/theme/VersionPicker.vue +++ b/docs/src/.vitepress/theme/VersionPicker.vue @@ -34,7 +34,7 @@ const getBaseRepository = () => { if (origin.includes('github.io')) { // Extract the first part of the path as the repository name const pathParts = pathname.split('/').filter(Boolean); - const baseRepo = pathParts.length > 0 ? `/${pathParts[0]}/` : '/'; + const baseRepo = pathParts.length > 0 ? `/${pathParts[0]}` : ''; return `${origin}${baseRepo}`; } else { // For custom domains, use just the origin (e.g., https://docs.makie.org)