diff --git a/.env.example b/.env.example index 8441684..5832e85 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,8 @@ # Public site origin without trailing slash (used for canonical, sitemap, OG URLs). # Examples: # https://sillage.app -# https://getsillage.github.io/website +# https://getsillage.github.io VITE_SITE_URL= -# Asset base path. Leave empty or "/" for custom domains / root hosting. -# For GitHub project pages without a custom domain: -# VITE_BASE=/website/ +# Asset base path. The canonical organization Pages site is hosted at the root. VITE_BASE=/ - diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 7b50dfc..aa59224 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -27,10 +27,9 @@ jobs: - name: Verify and build run: make check env: - # Custom domain: set repo variables SITE_URL and leave VITE_BASE empty. - # Default project Pages URL for this repo: - VITE_SITE_URL: ${{ vars.SITE_URL || 'https://getsillage.github.io/website' }} - VITE_BASE: ${{ vars.VITE_BASE || '/website/' }} + # Custom domain: override SITE_URL; organization Pages deploys at the root path. + VITE_SITE_URL: ${{ vars.SITE_URL || 'https://getsillage.github.io' }} + VITE_BASE: '/' REQUIRE_SITE_URL: '1' # actions/upload-pages-artifact is a composite action whose internal diff --git a/README.md b/README.md index 63658f0..8a3b8e0 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ Output is written to `dist/`. The post-build step rewrites `robots.txt` / `sitem ### GitHub Pages -1. Push this repository to GitHub. +1. Use the organization Pages repository name `getsillage.github.io`. 2. Settings → Pages → Source: **GitHub Actions**. -3. Optional: repository variable `SITE_URL` (e.g. `https://getsillage.github.io/website` or a custom domain). -4. Push to `main` — workflow **Deploy GitHub Pages** builds and publishes `dist/`. +3. The default public URL is `https://getsillage.github.io/`; set the repository variable `SITE_URL` only when using a custom domain. +4. Push to `main` — workflow **Deploy GitHub Pages** builds and publishes `dist/` at the root path. For a custom domain, add a `CNAME` file under `public/` (or configure it in the Pages UI) and set `SITE_URL` to that domain. diff --git a/package.json b/package.json index 1f4a73d..83b4e77 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "version": "1.0.0", "type": "module", "description": "Product showcase website for Sillage", - "homepage": "https://github.com/getsillage/website", + "homepage": "https://getsillage.github.io/", "repository": { "type": "git", - "url": "https://github.com/getsillage/website.git" + "url": "https://github.com/getsillage/getsillage.github.io.git" }, "license": "MIT", "scripts": { diff --git a/scripts/postbuild.test.ts b/scripts/postbuild.test.ts index 817508d..64137a3 100644 --- a/scripts/postbuild.test.ts +++ b/scripts/postbuild.test.ts @@ -51,8 +51,8 @@ describe('postbuild', () => { const dist = fixtureDist() const result = finalizeBuild({ dist, - siteUrl: 'https://getsillage.github.io/website', - base: '/website/', + siteUrl: 'https://getsillage.github.io', + base: '/', requireSiteUrl: true, now: new Date('2026-07-30T00:00:00Z'), }) @@ -60,19 +60,17 @@ describe('postbuild', () => { const headers = readFileSync(join(dist, '_headers'), 'utf8') const notFound = readFileSync(join(dist, '404.html'), 'utf8') - expect(result.siteUrl).toBe('https://getsillage.github.io/website') + expect(result.siteUrl).toBe('https://getsillage.github.io') + expect(html).toContain('rel="canonical" href="https://getsillage.github.io/"') expect(html).toContain( - 'rel="canonical" href="https://getsillage.github.io/website/"', - ) - expect(html).toContain( - 'property="og:image" content="https://getsillage.github.io/website/og.png"', + 'property="og:image" content="https://getsillage.github.io/og.png"', ) for (const hash of inlineScriptHashes(html)) expect(headers).toContain(hash) expect(headers).not.toContain('__SILLAGE_CSP__') - expect(notFound).toContain('content="0; url=/website/"') + expect(notFound).toContain('content="0; url=/"') expect(notFound).not.toMatch(/https://getsillage.github.io/website', + 'https://getsillage.github.io', ) }) @@ -81,7 +79,7 @@ describe('postbuild', () => { expect(() => finalizeBuild({ dist, - siteUrl: 'https://getsillage.github.io/website', + siteUrl: 'https://example.com/subpath', base: '/', requireSiteUrl: true, }), diff --git a/src/config/site.ts b/src/config/site.ts index 46eeba1..0a9c8fe 100644 --- a/src/config/site.ts +++ b/src/config/site.ts @@ -13,7 +13,7 @@ export const SITE = { githubOrg: 'getsillage', productRepo: 'getsillage/sillage', productRepoUrl: 'https://github.com/getsillage/sillage', - pageRepoUrl: 'https://github.com/getsillage/website', + pageRepoUrl: 'https://github.com/getsillage/getsillage.github.io', /** Fallback when GitHub Releases cannot be reached at runtime. */ defaultReleaseTag: 'v0.3.0', license: 'MIT', diff --git a/src/lib/assets.ts b/src/lib/assets.ts index 1ed562d..bb31535 100644 --- a/src/lib/assets.ts +++ b/src/lib/assets.ts @@ -1,4 +1,4 @@ -/** Public asset URL under the Vite base (works for / and /website/). */ +/** Public asset URL under the Vite base (works for root and subpath hosting). */ export function assetUrl(path: string): string { const base = import.meta.env.BASE_URL || '/' const normalized = path.replace(/^\/+/, '') diff --git a/vite.config.ts b/vite.config.ts index 27570fe..7ef5297 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,9 +2,8 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' -// For project-site GitHub Pages (org.github.io/website), set: -// VITE_BASE=/website/ -// Custom domains and apex sites should leave base as '/'. +// Organization GitHub Pages and custom domains use '/'. Subpath hosts can +// override VITE_BASE when building outside the canonical deployment. const rawBase = process.env.VITE_BASE?.trim() const base = !rawBase || rawBase === '/' ? '/' : rawBase.endsWith('/') ? rawBase : `${rawBase}/` @@ -17,4 +16,3 @@ export default defineConfig({ sourcemap: false, }, }) -