From 89f2a6c41d92a332fc32ebe657a4753cf2df752a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 18 Mar 2026 18:44:51 +0000 Subject: [PATCH 1/3] fix: honor pages base path for astro assets Co-authored-by: Michael Villalba Sotelo --- .github/workflows/static.yml | 2 ++ apps/website/astro.config.mjs | 7 ++++++- apps/website/src/components/background.astro | 8 +++----- apps/website/src/components/navbar.astro | 5 +++-- apps/website/src/components/page-navigation-loader.astro | 8 +++----- apps/website/src/components/projects-page.astro | 5 +++-- apps/website/src/components/theme-switcher.astro | 8 +++----- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index aaccc7d..3b1d47b 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -47,6 +47,8 @@ jobs: - name: Build run: pnpm exec nx run website:build + env: + BASE_URL: /visomi.dev/ - name: Setup Pages uses: actions/configure-pages@v5 diff --git a/apps/website/astro.config.mjs b/apps/website/astro.config.mjs index c924192..1c738c9 100644 --- a/apps/website/astro.config.mjs +++ b/apps/website/astro.config.mjs @@ -1,7 +1,12 @@ import { defineConfig } from 'astro/config'; import tailwindcss from '@tailwindcss/vite'; -const base = process.env.BASE_URL ?? '/'; +const repositoryName = process.env.GITHUB_REPOSITORY?.split('/')[1]; +const isProjectPagesDeployment = Boolean( + process.env.GITHUB_ACTIONS && repositoryName && !repositoryName.endsWith('.github.io'), +); +const defaultBase = isProjectPagesDeployment ? `/${repositoryName}/` : '/'; +const base = process.env.BASE_URL ?? defaultBase; const site = process.env.SITE_URL ?? 'https://visomi.dev'; export default defineConfig({ diff --git a/apps/website/src/components/background.astro b/apps/website/src/components/background.astro index 82e7bab..67b0a3b 100644 --- a/apps/website/src/components/background.astro +++ b/apps/website/src/components/background.astro @@ -1,7 +1,3 @@ ---- -import backgroundScriptUrl from '../scripts/background.ts?url'; ---- - - + diff --git a/apps/website/src/components/page-navigation-loader.astro b/apps/website/src/components/page-navigation-loader.astro index 0ee016b..6ec6db1 100644 --- a/apps/website/src/components/page-navigation-loader.astro +++ b/apps/website/src/components/page-navigation-loader.astro @@ -1,9 +1,7 @@ ---- -import pageNavigationLoaderScriptUrl from '../scripts/page-navigation-loader.ts?url'; ---- - - + diff --git a/apps/website/src/components/projects-page.astro b/apps/website/src/components/projects-page.astro index 04c2f8a..2670945 100644 --- a/apps/website/src/components/projects-page.astro +++ b/apps/website/src/components/projects-page.astro @@ -1,6 +1,5 @@ --- import { createTranslator, type Locale } from '../i18n/translations'; -import projectsScriptUrl from '../scripts/projects.ts?url'; type Props = { locale: Locale; @@ -198,4 +197,6 @@ const t = createTranslator(locale); - + diff --git a/apps/website/src/components/theme-switcher.astro b/apps/website/src/components/theme-switcher.astro index 4c9f2ff..7774d74 100644 --- a/apps/website/src/components/theme-switcher.astro +++ b/apps/website/src/components/theme-switcher.astro @@ -1,7 +1,3 @@ ---- -import themeSwitcherScriptUrl from '../scripts/theme-switcher.ts?url'; ---- - - + From 6e8900923a60d9778d54570ebf789f28351e693f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 18 Mar 2026 19:03:15 +0000 Subject: [PATCH 2/3] fix: keep astro base path env driven Co-authored-by: Michael Villalba Sotelo --- apps/website/astro.config.mjs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/website/astro.config.mjs b/apps/website/astro.config.mjs index 1c738c9..c924192 100644 --- a/apps/website/astro.config.mjs +++ b/apps/website/astro.config.mjs @@ -1,12 +1,7 @@ import { defineConfig } from 'astro/config'; import tailwindcss from '@tailwindcss/vite'; -const repositoryName = process.env.GITHUB_REPOSITORY?.split('/')[1]; -const isProjectPagesDeployment = Boolean( - process.env.GITHUB_ACTIONS && repositoryName && !repositoryName.endsWith('.github.io'), -); -const defaultBase = isProjectPagesDeployment ? `/${repositoryName}/` : '/'; -const base = process.env.BASE_URL ?? defaultBase; +const base = process.env.BASE_URL ?? '/'; const site = process.env.SITE_URL ?? 'https://visomi.dev'; export default defineConfig({ From c53b628917f6cd50fa373febbcb2e92d31abde48 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 18 Mar 2026 20:00:05 +0000 Subject: [PATCH 3/3] refactor: use astro local script imports Co-authored-by: Michael Villalba Sotelo --- apps/website/src/components/background.astro | 4 +--- apps/website/src/components/navbar.astro | 4 +--- apps/website/src/components/page-navigation-loader.astro | 4 +--- apps/website/src/components/projects-page.astro | 4 +--- apps/website/src/components/theme-switcher.astro | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/apps/website/src/components/background.astro b/apps/website/src/components/background.astro index 67b0a3b..c4b6453 100644 --- a/apps/website/src/components/background.astro +++ b/apps/website/src/components/background.astro @@ -16,6 +16,4 @@ - + diff --git a/apps/website/src/components/navbar.astro b/apps/website/src/components/navbar.astro index a69e202..0a09406 100644 --- a/apps/website/src/components/navbar.astro +++ b/apps/website/src/components/navbar.astro @@ -96,7 +96,5 @@ const navItems = [ - + diff --git a/apps/website/src/components/page-navigation-loader.astro b/apps/website/src/components/page-navigation-loader.astro index 6ec6db1..4647608 100644 --- a/apps/website/src/components/page-navigation-loader.astro +++ b/apps/website/src/components/page-navigation-loader.astro @@ -2,6 +2,4 @@
- + diff --git a/apps/website/src/components/projects-page.astro b/apps/website/src/components/projects-page.astro index 2670945..8225c1f 100644 --- a/apps/website/src/components/projects-page.astro +++ b/apps/website/src/components/projects-page.astro @@ -197,6 +197,4 @@ const t = createTranslator(locale); - + diff --git a/apps/website/src/components/theme-switcher.astro b/apps/website/src/components/theme-switcher.astro index 7774d74..d1750c3 100644 --- a/apps/website/src/components/theme-switcher.astro +++ b/apps/website/src/components/theme-switcher.astro @@ -37,6 +37,4 @@ - +