Skip to content

Commit

Permalink
fix ico
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Dec 16, 2024
1 parent 8551fb2 commit 79781c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
import mathjax3 from "markdown-it-mathjax3";

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]}/` : '/';
}
Expand Down Expand Up @@ -87,7 +86,7 @@ export default defineConfig({
// cleanUrls: true,
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
head: [
['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }],
['link', { rel: 'icon', href: '/favicon.ico' }],
['script', {src: `${getBaseRepository(baseTemp.base)}versions.js`}],
['script', {src: `${baseTemp.base}siteinfo.js`}]
],
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/VersionPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -139,4 +139,4 @@ onMounted(loadVersions);
.VPVersionPicker:hover :deep(button .text) {
color: var(--vp-c-text-2) !important;
}
</style>
</style>

0 comments on commit 79781c9

Please sign in to comment.