Skip to content

Serve the site at the genairosity.com root - #87

Merged
komali2 merged 1 commit into
mainfrom
serve-site-at-custom-domain
Oct 29, 2026
Merged

komali2 merged 1 commit into
mainfrom
serve-site-at-custom-domain

Conversation

@komali2

@komali2 komali2 commented Oct 29, 2026

Copy link
Copy Markdown
Member

Why

https://genairosity.com/ returns 200 for its pages but 404s on every stylesheet
and image. The DNS change was fine; the build did not know the site had moved.

.github/workflows/pages.yml derived SITE_BASE_PATH from the repository name, so
each page was generated with the project-pages prefix baked in:

<link rel="stylesheet" href="/genairosity/assets/style.css">

Correct at 508-dev.github.io/genairosity/. The custom domain serves the same
artifact one level up, so the real file is /assets/style.css and the requested
path does not exist.

What changed

  • site/CNAME declares genairosity.com and becomes the source of truth for how
    links are written. It also keeps the Pages configuration from losing the domain,
    since an Actions deployment replaces the published root wholesale.
  • .github/workflows/pages.yml builds with an empty prefix while that file
    exists, and falls back to the repository prefix otherwise. Deleting site/CNAME is
    enough to return to the project URL.
  • scripts/build.ts copies CNAME into dist, and throws when a non-empty
    SITE_BASE_PATH is passed alongside a declared domain. That pairing only ever
    publishes asset URLs that 404, so it should fail the build rather than the site.
  • tests/foundation.test.ts resolves every root-relative href/src in the
    built output against a real file, and covers the conflict guard.
  • docs/deployment.md, README.md record the production URL and the prefix
    rules, including how to move back.

Verification

./scripts/check-all.sh passes (27 tests). The local build emits root-relative
assets and dist/CNAME:

href="/assets/style.css"
src="/assets/freedom.svg"

After merge, confirm the deployment succeeds and that Settings → Pages still shows
genairosity.com, then reload the site and check that styles apply.

🤖 Generated with Claude Code

The Pages workflow derived the link prefix from the repository name, so every
generated page requested its stylesheet and images under /genairosity/. That
was correct at 508-dev.github.io/genairosity/, but the custom domain serves the
artifact one level up, leaving every asset URL a 404.

Declare the domain in site/CNAME and treat that file as the source of truth for
how links are written: the workflow builds with an empty prefix while it exists,
and the build copies it into the artifact so a deployment cannot drop the domain
from the Pages configuration. The build now refuses a subpath prefix alongside a
declared domain, because that pairing only ever publishes broken asset URLs.
Deleting site/CNAME restores the repository prefix without further changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69bc218e-c7ed-4a51-9d28-539512668ee5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@komali2
komali2 merged commit 3336db3 into main Oct 29, 2026
7 checks passed
@komali2
komali2 deleted the serve-site-at-custom-domain branch October 29, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant