Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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=/

7 changes: 3 additions & 4 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
18 changes: 8 additions & 10 deletions scripts/postbuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,26 @@ 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'),
})
const html = readFileSync(join(dist, 'index.html'), 'utf8')
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(/<script\b|<style\b|\sstyle=/)
expect(readFileSync(join(dist, 'sitemap.xml'), 'utf8')).toContain(
'<loc>https://getsillage.github.io/website</loc>',
'<loc>https://getsillage.github.io</loc>',
)
})

Expand All @@ -81,7 +79,7 @@ describe('postbuild', () => {
expect(() =>
finalizeBuild({
dist,
siteUrl: 'https://getsillage.github.io/website',
siteUrl: 'https://example.com/subpath',
base: '/',
requireSiteUrl: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/assets.ts
Original file line number Diff line number Diff line change
@@ -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(/^\/+/, '')
Expand Down
6 changes: 2 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`

Expand All @@ -17,4 +16,3 @@ export default defineConfig({
sourcemap: false,
},
})

Loading