From 76927d009c7cb5686180ffe4be63e97ec972e777 Mon Sep 17 00:00:00 2001 From: ssavutu Date: Thu, 6 Aug 2026 01:02:43 -0400 Subject: [PATCH] Point "View Live" links at production The published image baked in dev.thetriangle.org, which was right while the CMS was not driving production: an unconfigured build aimed at www would have sent editors to pages that did not reflect what they had just saved. That reverses at cutover. With the CMS behind www, a "View Live" link to dev sends editors to a copy of the site their readers never see -- and dev sits behind Cloudflare Access, so for anyone without access it does not resolve at all. The value is inlined by Vite at build time and publish.yml passes no build-arg, so the Dockerfile default is what actually ships; the TypeScript fallback is updated to match so the two cannot disagree. Override with --build-arg to aim a build at dev. Co-Authored-By: Claude Opus 5 --- frontend/Dockerfile | 2 +- frontend/src/auth/urls.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5603a97..aff7b8e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app # Baked in at build time (Vite inlines import.meta.env), so this is the origin # every "View Live" link and permalink preview in the published image points at. # Override with --build-arg to publish an image aimed at another site. -ARG VITE_PUBLIC_SITE_URL="https://dev.thetriangle.org" +ARG VITE_PUBLIC_SITE_URL="https://www.thetriangle.org" ENV VITE_PUBLIC_SITE_URL=${VITE_PUBLIC_SITE_URL} COPY package.json package-lock.json ./ diff --git a/frontend/src/auth/urls.ts b/frontend/src/auth/urls.ts index ac218a2..7bb25ce 100644 --- a/frontend/src/auth/urls.ts +++ b/frontend/src/auth/urls.ts @@ -12,11 +12,11 @@ export function authBaseUrl() { // Public-facing site origin, used for article permalinks (e.g. so Yoast can // tell internal links from outbound ones) and for the "View Live" links. -// Defaults to the dev site: the CMS is not yet driving production, so an -// unconfigured build pointing at www would send editors to pages that do not -// reflect what they just saved. +// Defaults to www now that the CMS drives production: an unconfigured build +// pointing at dev would send editors to a copy of the site their readers never +// see. Override with VITE_PUBLIC_SITE_URL to aim a build at dev instead. export function publicSiteUrl() { - return trimTrailingSlashes(import.meta.env.VITE_PUBLIC_SITE_URL ?? "https://dev.thetriangle.org") + return trimTrailingSlashes(import.meta.env.VITE_PUBLIC_SITE_URL ?? "https://www.thetriangle.org") } // The public permalink for a slug. The URL is fully determined by the slug, so