Skip to content

Commit 4a47283

Browse files
schaconcursoragent
andauthored
Fix site asset and link paths for the progit3.com custom domain (#12)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 6b7a71f commit 4a47283

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ jobs:
4444
publish_branch: gh-pages
4545
publish_dir: site/dist
4646
force_orphan: true
47+
# Keep the custom-domain CNAME file on gh-pages; without this,
48+
# force_orphan would delete it on every deploy and detach the domain.
49+
cname: progit3.com

site/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ agent-generated posts.**
7272
publishes `site/dist/` to the `gh-pages` branch with
7373
[peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages).
7474
Point GitHub Pages at the `gh-pages` branch (Settings → Pages → Deploy from a
75-
branch) and the site is served at <https://progit.github.io/progit3/>.
75+
branch) and the site is served at <https://progit3.com/>.
7676

77-
The canonical URL and base path default to `https://progit.github.io` and
78-
`/progit3`; override them with the `SITE_URL` and `BASE_PATH` environment
79-
variables (e.g. for a fork or a custom domain).
77+
The canonical URL and base path default to `https://progit3.com` and
78+
`/`; override them with the `SITE_URL` and `BASE_PATH` environment
79+
variables (e.g. for a fork served at `https://<user>.github.io/progit3/`).

site/astro.config.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import { defineConfig } from 'astro/config';
33
import mdx from '@astrojs/mdx';
44

5-
// GitHub Pages project site: https://progit.github.io/progit3/
6-
// Override SITE_URL / BASE_PATH for forks or a custom domain.
7-
const site = process.env.SITE_URL ?? 'https://progit.github.io';
8-
const base = process.env.BASE_PATH ?? '/progit3';
5+
// GitHub Pages with a custom domain: https://progit3.com/
6+
// Override SITE_URL / BASE_PATH for forks (e.g. https://<user>.github.io and /progit3).
7+
const site = process.env.SITE_URL ?? 'https://progit3.com';
8+
const base = process.env.BASE_PATH ?? '/';
99

1010
export default defineConfig({
1111
site,

site/scripts/build-book.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { fileURLToPath } from 'node:url';
2222

2323
const siteRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
2424
const repoRoot = path.resolve(siteRoot, '..');
25-
const base = (process.env.BASE_PATH ?? '/progit3').replace(/\/+$/, '');
25+
const base = (process.env.BASE_PATH ?? '/').replace(/\/+$/, '');
2626

2727
// ---------------------------------------------------------------------------
2828
// 1. Make sure book/contributors.txt exists (mirrors the Rakefile task).

0 commit comments

Comments
 (0)