Skip to content

Commit e0996ec

Browse files
committed
docs: adjust docs deploy base for custom domain
Remove the DOCS_BASE environment variable from the docs CI build step, as the custom
1 parent 19cb656 commit e0996ec

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ jobs:
4646
# docs/ is a separate pnpm project with its own workspace and lockfile.
4747
- run: pnpm install --frozen-lockfile
4848
working-directory: docs
49-
# TEMPORARY — remove this `env:` block the moment scrollstack.js.org is
50-
# attached in Settings > Pages. Until then the site is served from the bare
51-
# project URL (…github.io/scrollstackjs/) and needs the matching sub-path
52-
# base, or every asset 404s against the host root. See docs/.vitepress/config.ts.
49+
# Builds at base '/' — scrollstack.js.org is attached, and `public/CNAME`
50+
# keeps it attached across deploys. Do NOT reintroduce `DOCS_BASE` here:
51+
# the sub-path base bakes /scrollstackjs/ into every asset URL, which 404s
52+
# against the custom domain's root. See docs/.vitepress/config.ts.
5353
- run: pnpm run build
5454
working-directory: docs
55-
env:
56-
DOCS_BASE: /scrollstackjs/
5755

5856
- uses: actions/configure-pages@v5
5957
- uses: actions/upload-pages-artifact@v3

‎docs/docs/.vitepress/config.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ const REPO = 'https://github.com/devgauravjatt/scrollstackjs'
1313
// https://scrollstack.js.org/ → base '/' (custom domain)
1414
// https://devgauravjatt.github.io/scrollstackjs/ → base '/scrollstackjs/' (bare project URL)
1515
//
16-
// So CI passes it in. `DOCS_BASE=/scrollstackjs/` until the js.org subdomain resolves;
17-
// drop the env var from the workflow the moment the custom domain is attached.
16+
// The custom domain is attached, so CI builds at the default '/' and `public/CNAME`
17+
// keeps it that way. `DOCS_BASE` stays as an escape hatch for building the bare
18+
// project URL — setting it for a scrollstack.js.org deploy 404s every asset.
1819
// VitePress has no relative-base mode, so this really is either/or.
1920
const base = process.env.DOCS_BASE ?? '/'
2021

0 commit comments

Comments
 (0)