refactor(public): use environment variables for base URL and improve accessibility

Switch landing and layout metadata to use BASE_URL from environment for
deployment flexibility. Refine privacy page environment check for robustness.
Update ARIA attributes on landing preview for better accessibility. Adjust
terminal and visually hidden styles for improved formatting and screen reader
support.
This commit is contained in:
Richard R 2026-05-31 16:29:40 -06:00
parent 0b1e293638
commit 27267e5ffb
4 changed files with 16 additions and 7 deletions

View file

@ -16,7 +16,7 @@ export const metadata: Metadata = {
openGraph: {
type: 'website',
locale: 'en_US',
url: 'https://openreader.richardr.dev',
url: process.env.BASE_URL || 'https://openreader.richardr.dev',
siteName: 'OpenReader',
title: 'OpenReader | Read documents with synchronized audio',
description:
@ -131,7 +131,7 @@ export default async function LandingPage() {
</div>
{/* Reader mockup: demonstrates the synchronized highlight + playback */}
<aside className="public-reader public-reveal-2" aria-label="OpenReader playback preview">
<aside className="public-reader public-reveal-2" aria-hidden="true">
<div className="public-reader-glow" aria-hidden="true" />
<div className="public-reader-bar">
<span className="public-reader-dot" data-tone="a" />

View file

@ -18,7 +18,8 @@ export const metadata: Metadata = {
export default async function PrivacyPage() {
const effectiveDate = 'February 17, 2026';
const isRichardrDevProductionInstance = process.env.RICHARDRDEV_PRODUCTION === 'true';
const isRichardrDevProductionInstance =
process.env.RICHARDRDEV_PRODUCTION?.trim().toLowerCase() === 'true';
const hdrs = await headers();
const host = hdrs.get('host') ?? 'this server';

View file

@ -94,7 +94,7 @@
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
clip-path: inset(50%);
white-space: nowrap;
}
@ -192,6 +192,11 @@
.public-nav-divider {
display: none;
}
.public-terminal-body {
padding: 0.9rem 1rem 1.1rem;
font-size: 0.74rem;
}
}
/* ────────────────────────────── Hero ────────────────────────────── */
@ -747,8 +752,11 @@
font-size: 0.82rem;
line-height: 1.7;
color: var(--pub-soft);
white-space: pre-wrap;
word-break: break-word;
/* Preserve the command's formatting and scroll within the box instead of
wrapping mid-token, which breaks the layout on narrow screens. */
white-space: pre;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.public-term-comment { color: var(--pub-muted); }

View file

@ -40,7 +40,7 @@ export const metadata: Metadata = {
template: "%s | OpenReader",
},
manifest: "/manifest.json",
metadataBase: new URL("https://openreader.richardr.dev"),
metadataBase: new URL(process.env.BASE_URL || "https://openreader.richardr.dev"),
verification: {
google: "MJXyTudn1kgQF8EtGD-tsnAWev7Iawso9hEvqeGHB3U",
},