Skip to content

Commit 2dd3e4e

Browse files
committed
Serve the site at the domain root instead of /documentdb.github.io
This repository is the organization Pages site with a custom domain, so the deployed artifact is served at the root of documentdb.io. Building with NEXT_BASE_PATH set to the repository name prefixes every internal link and asset URL with /documentdb.github.io/, which GitHub Pages then 301-redirects back to the root on every request: every CSS/JS/font/image load pays an extra round trip (defeating the font preload), and after any client-side navigation the prefixed URL is what users see and share in the address bar. Drop NEXT_BASE_PATH and pin JEKYLL_BASE_PATH to /blogs so generated URLs match where GitHub Pages actually serves the files. This also makes the CI build-validation job (which already builds without NEXT_BASE_PATH) exercise the same configuration that production ships.
1 parent dd4e786 commit 2dd3e4e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎.github/workflows/continuous-deployment.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ jobs:
7777
- name: Install dependencies
7878
run: npm ci
7979
- name: Build with Next.js
80+
# This repository is the organization Pages site served at the root of
81+
# the custom domain (documentdb.io), so the build must NOT set
82+
# NEXT_BASE_PATH. Setting it to the repository name (the usual trick
83+
# for project pages) prefixes every internal link and asset URL with
84+
# /documentdb.github.io/, which GitHub Pages then 301-redirects back
85+
# to the root on every request and leaves the prefixed URL visible in
86+
# the address bar after client-side navigation.
8087
env:
81-
NEXT_BASE_PATH: ${{ github.event.repository.name }}
82-
JEKYLL_BASE_PATH: /${{ github.event.repository.name }}/blogs
88+
JEKYLL_BASE_PATH: /blogs
8389
run: npm run build
8490
- name: Download DocumentDB packages from latest release
8591
run: .github/scripts/download_packages.sh

0 commit comments

Comments
 (0)