Skip to content

chore(frontend): point View Live at the configured public site - #127

Merged
ssavutu merged 1 commit into
mainfrom
chore/view-live-public-site-url
Aug 1, 2026
Merged

chore(frontend): point View Live at the configured public site#127
ssavutu merged 1 commit into
mainfrom
chore/view-live-public-site-url

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 1, 2026

Copy link
Copy Markdown
Member

The View Live link on the articles list built its URL from a hardcoded https://www.thetriangle.org, even though VITE_PUBLIC_SITE_URL already existed and was already plumbed through the frontend image as a build arg — the comments view and the editor's permalink preview both read it. Only this link didn't, so it could send an editor to a different site than the rest of the CMS pointed at.

Changes

  • View Live uses the existing publicSiteUrl() helper.
  • Default set to https://dev.thetriangle.org in both places that define it: the runtime fallback in src/auth/urls.ts, and the ARG in frontend/Dockerfile — the latter is what the published image actually gets, since publish.yml passes no --build-arg. Changing only one would leave the other on www.
  • The dashboard's View site button had the same hardcoded origin; included, since fixing only one would split the two buttons across two sites.

Verification

npm run build clean; grepped the built bundle — dev.thetriangle.org present, www.thetriangle.org gone. No hardcoded origin remains in the frontend.

Note

Vite inlines import.meta.env at build time, so this is baked into the image rather than read at container start. Retargeting a deployed image means rebuilding with --build-arg VITE_PUBLIC_SITE_URL=…. Adding build-args to the frontend step in publish.yml would give CI per-environment control; not done here.

🤖 Generated with Claude Code

The "View Live" link on the articles list built its URL from a hardcoded
https://www.thetriangle.org, even though VITE_PUBLIC_SITE_URL already existed
and was already plumbed through the frontend image as a build arg — the
comments view and the editor's permalink preview both read it. Only this link
did not, so it could send an editor to a different site than the rest of the
CMS pointed at.

Use publicSiteUrl() here too, and set the default to dev.thetriangle.org in
both places that define it: the runtime fallback in urls.ts and the ARG in
the frontend Dockerfile, which is what the published image actually gets
since CI passes no build-arg. The CMS is not driving production yet, so an
unconfigured build aimed at www would show editors pages that do not reflect
what they just saved.

The dashboard's "View site" button had the same hardcoded origin and is
included — leaving it would have split the two buttons across two sites.
No hardcoded origin remains in the frontend; verified in the built bundle.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu merged commit 49de70c into main Aug 1, 2026
6 checks passed
@ssavutu
ssavutu deleted the chore/view-live-public-site-url branch August 1, 2026 01:20
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