Reply time setting, and server settings from process.env only

Inquiries and the sent page promise a reply within the site setting
replyTime (2 days, Greg 2026-10-11). The site reads its settings through one
helper that uses process.env only, so a .env file can never be copied into the
built bundle through import.meta.env.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
This commit is contained in:
Claude
2026-10-11 23:18:07 +00:00
parent 0d0b8e4085
commit 60dfeecd7f
6 changed files with 21 additions and 4 deletions
@@ -7,6 +7,7 @@ import Seal from "@gk/ui/components/Seal.astro";
import Star from "@gk/ui/components/Star.astro";
import StatusPill from "@gk/ui/components/StatusPill.astro";
import ChoicePills from "../../components/work/ChoicePills.astro";
import { env } from "../../lib/env.ts";
import { site } from "../../lib/page.ts";
import { inquiryTypes, parseInquiryType, type InquiryType } from "../../lib/work.ts";
@@ -15,7 +16,7 @@ const settings = s.settings();
const text = s.pageText("/inquiries");
const selected = parseInquiryType(Astro.url.searchParams.get("type"));
const lede = text?.data.lede ?? "Roles, freelance web work or a custom Patiun order. Pick one and the form asks the right questions.";
const quickFacts = text?.data.quickFacts?.map((f) => f.text) ?? ["Replies within [PLACEHOLDER] days", "Read by me, not a bot"];
const quickFacts = text?.data.quickFacts?.map((f) => f.text) ?? [`Replies within ${s.settings()?.replyTime ?? "a few days"}`, "Read by me, not a bot"];
const socials = settings?.socials ?? [];
const placeholders: Record<InquiryType | "none", string> = {
@@ -29,7 +30,6 @@ const timing = [
{ value: "within-a-month", label: "Within a month" },
{ value: "date", label: "A specific date" },
];
const env = (k: string) => (process.env[k] ?? import.meta.env[k]) as string | undefined;
const turnstileKey = env("PUBLIC_TURNSTILE_SITE_KEY") ?? env("TURNSTILE_SITE_KEY");
---
<PageShell title="Inquiries" family="inquiries" current="inquiries" description="Ask about a role, freelance web work or a custom Patiun order.">
+3 -1
View File
@@ -12,7 +12,9 @@ import Star from "@gk/ui/components/Star.astro";
import TickRing from "@gk/ui/components/TickRing.astro";
import TickScale from "@gk/ui/components/TickScale.astro";
import { inquiryTypes, parseInquiryType, parseSentSummary } from "../../lib/work.ts";
import { site } from "../../lib/page.ts";
const replyTime = (await site().catch(() => null))?.settings()?.replyTime ?? "a few days";
const sent = parseSentSummary(Astro.cookies.get("gk-inquiry")?.value);
if (sent) Astro.cookies.delete("gk-inquiry", { path: "/" });
Astro.response.headers.set("Cache-Control", "private, no-store");
@@ -38,7 +40,7 @@ const steps = [
<Seal name="transmutation" size={132} class="seal" />
<span class="eyebrow">Inquiry sent</span>
<h1>Your note is on its way</h1>
<p class="lede">Thanks{firstName ? `, ${firstName}` : ""}. I read every inquiry myself and reply within [PLACEHOLDER] days.</p>
<p class="lede">Thanks{firstName ? `, ${firstName}` : ""}. I read every inquiry myself and reply within {replyTime}.</p>
<ol class="steps" aria-label="What happens next">
{
steps.map((st, i) => (