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
3 changes: 3 additions & 0 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ jobs:
publish_branch: gh-pages
publish_dir: site/dist
force_orphan: true
# Keep the custom-domain CNAME file on gh-pages; without this,
# force_orphan would delete it on every deploy and detach the domain.
cname: progit3.com
8 changes: 4 additions & 4 deletions site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ The file name (without `.mdx`) becomes the URL: `/blog/<file-name>/`.
publishes `site/dist/` to the `gh-pages` branch with
[peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages).
Point GitHub Pages at the `gh-pages` branch (Settings → Pages → Deploy from a
branch) and the site is served at <https://progit.github.io/progit3/>.
branch) and the site is served at <https://progit3.com/>.

The canonical URL and base path default to `https://progit.github.io` and
`/progit3`; override them with the `SITE_URL` and `BASE_PATH` environment
variables (e.g. for a fork or a custom domain).
The canonical URL and base path default to `https://progit3.com` and
`/`; override them with the `SITE_URL` and `BASE_PATH` environment
variables (e.g. for a fork served at `https://<user>.github.io/progit3/`).
8 changes: 4 additions & 4 deletions site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';

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

export default defineConfig({
site,
Expand Down
2 changes: 1 addition & 1 deletion site/scripts/build-book.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { fileURLToPath } from 'node:url';

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

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