Skip to content

Commit

Permalink
docs: fix links solution for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sparecycles committed Sep 5, 2024
1 parent f524dc8 commit 7e367db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import solid from "@astrojs/solid-js";

// https://astro.build/config
export default defineConfig({
site: process.env.SITE_ORIGIN ?? undefined,
base: process.env.SITE_ROOT ?? undefined,
site: process.env.SITE_ORIGIN,
base: process.env.SITE_ROOT ?? '/',
output: "static",
integrations: [
starlight({
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/components/CollectionLinkCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ async function resolveCollection(
return "docs";
}
console.log('href', href)
if (typeof href === "string" && /^[/]/.test(href)) {
const resolvedCollection = await resolveCollection(collection);
const entry = await getEntry(resolvedCollection, href.slice(1));
data = entry?.data;
href = import.meta.env.BASE_URL + href;
href = (import.meta.env.BASE_URL) + href.slice(import.meta.env.BASE_URL.endsWith('/') ? 1 : 0);
}
---

Expand Down

0 comments on commit 7e367db

Please sign in to comment.