Skip to content

Commit 293445d

Browse files
Bambushuclaude
andcommitted
Demo-mode: swap public bake form for "contact for a demo" CTA
When LEDE_CONTACT_URL is set, the bake section renders a CTA pointing at that URL (mailto: or https://) instead of the live BakeForm. Used on the hosted Vercel demo so anonymous visitors don't burn the maintainer's API budget. Self-hosters that leave it unset keep the form. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 656ca0f commit 293445d

4 files changed

Lines changed: 60 additions & 6 deletions

File tree

.env.example

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ PUBLIC_SITE_URL=
1717

1818
# OPTIONAL: gate the demo behind basic auth.
1919
# When set, every request requires `Basic <base64(lede:password)>`.
20-
# Browser prompts once. Send GGI the URL + the password in the same note.
20+
# Browser prompts once.
2121
LEDE_DEMO_PASSWORD=
2222

23+
# OPTIONAL: demo-mode CTA. When set, the public bake form is replaced with a
24+
# "Contact for a demo" CTA pointing at this URL. Use to make a hosted deploy a
25+
# lead-gen surface instead of letting visitors burn the host's API budget.
26+
# Accepts any URL (mailto:, https://, etc.). Leave unset for self-host that
27+
# wants the live form.
28+
LEDE_CONTACT_URL=
29+
2330
# OPTIONAL: enable local mflux generations (Apple Silicon host only).
2431
# When unset or "0", the per-tile redo button on local generations is hidden.
2532
LEDE_LOCAL_AVAILABLE=

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Auto-detected from what you paste; you can also force a kind via the API.
5757
| `OPENROUTER_BRIEF_MODEL` | `anthropic/claude-sonnet-4.6` | Which model writes the brief. |
5858
| `LEDE_COST_CAP_USD` | `0.75` | Max estimated cost **per single bake** (sanity guard, not a budget). See cost section below. |
5959
| `LEDE_DEMO_PASSWORD` | (unset) | When set, all routes require `Basic <base64(lede:password)>`. Browser prompts once per session. |
60+
| `LEDE_CONTACT_URL` | (unset) | When set, the public bake form is swapped for a "Contact for a demo" CTA pointing at this URL (`mailto:` or `https://`). Used on hosted deploys to avoid visitor API-budget drain. |
6061
| `LEDE_LOCAL_AVAILABLE` | (unset) | Set to `1` when running on a host with `mflux` installed; surfaces the local-redo button. |
6162
| `LEDE_EPHEMERAL` | auto (true on Vercel) | When true, visitor bakes don't persist. Defaults to true if `VERCEL=1`. |
6263
| `UPSTASH_REDIS_REST_URL` + `UPSTASH_REDIS_REST_TOKEN` | (unset) | Rate-limit storage. When absent, falls back to in-process memory (dev only). |

src/app/page.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from 'next/link';
22
import { listGrouped } from '@/lib/loader';
33
import { BakeForm } from '@/components/bake-form';
4+
import { ContactCta } from '@/components/contact-cta';
45
import { ArticleCard } from '@/components/article-card';
56
import { isEphemeral } from '@/lib/runtime-mode';
67

@@ -11,6 +12,12 @@ const REPO_URL = 'https://github.com/Bambushu/lede';
1112
export default async function Home() {
1213
const { canonical, userSubmitted } = await listGrouped();
1314
const showVisitorSection = !isEphemeral();
15+
// When LEDE_CONTACT_URL is set, swap the public bake form for a
16+
// "contact for a demo" CTA. Used on the hosted demo so anonymous
17+
// visitors don't burn the maintainer's API budget. Self-hosters who
18+
// leave it unset get the form as usual.
19+
const contactUrl = process.env.LEDE_CONTACT_URL;
20+
const demoMode = Boolean(contactUrl);
1421

1522
return (
1623
<div className="min-h-screen">
@@ -115,17 +122,20 @@ export default async function Home() {
115122
<section id="bake" className="border-b border-rule">
116123
<div className="max-w-7xl mx-auto px-6 lg:px-12 py-20 grid grid-cols-1 lg:grid-cols-12 gap-12">
117124
<div className="lg:col-span-4">
118-
<span className="eyebrow mb-4">Run one yourself</span>
125+
<span className="eyebrow mb-4">
126+
{demoMode ? 'See it on your articles' : 'Run one yourself'}
127+
</span>
119128
<h2 className="font-display text-4xl leading-tight tracking-tight font-medium mt-2">
120-
Paste a URL, text, or HTML.
129+
{demoMode ? 'Want a private demo?' : 'Paste a URL, text, or HTML.'}
121130
</h2>
122131
<p className="mt-4 text-ink-soft leading-relaxed">
123-
Lede fetches or parses it, writes the brief, and bakes three lead images side by
124-
side. Most runs finish inside three minutes.
132+
{demoMode
133+
? "Live baking is gated on this hosted demo so the API budget doesn't get drained. Drop me a line and I'll run a private demo against your own articles, or clone the repo for a self-hosted run."
134+
: 'Lede fetches or parses it, writes the brief, and bakes three lead images side by side. Most runs finish inside three minutes.'}
125135
</p>
126136
</div>
127137
<div className="lg:col-span-8">
128-
<BakeForm />
138+
{demoMode ? <ContactCta href={contactUrl!} /> : <BakeForm />}
129139
</div>
130140
</div>
131141
</section>

src/components/contact-cta.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Demo-mode CTA. Replaces the BakeForm on the public Vercel deploy where
3+
* arbitrary visitors shouldn't burn the host's API budget. Activated by the
4+
* `LEDE_CONTACT_URL` env var; absent → BakeForm renders as usual.
5+
*/
6+
export function ContactCta({ href }: { href: string }) {
7+
return (
8+
<div className="space-y-6">
9+
<p className="text-lg leading-relaxed text-ink-soft max-w-xl">
10+
I run private demos against real publisher backlogs — paste a handful
11+
of your own article URLs, see the brief synth plus a three-model
12+
bakeoff against your actual headlines. Takes about ten minutes.
13+
</p>
14+
<p className="text-ink-soft leading-relaxed max-w-xl">
15+
For a self-hosted run with your own API keys, the source is{' '}
16+
<a
17+
href="https://github.com/Bambushu/lede"
18+
target="_blank"
19+
rel="noopener noreferrer"
20+
className="text-ink underline-offset-4 hover:underline"
21+
>
22+
on GitHub
23+
</a>{' '}
24+
— clone, paste any URL, and you have your own.
25+
</p>
26+
<div>
27+
<a
28+
href={href}
29+
className="inline-block px-8 py-4 bg-ink text-paper font-mono text-sm uppercase tracking-wider hover:bg-accent transition-colors"
30+
>
31+
Contact for a demo →
32+
</a>
33+
</div>
34+
</div>
35+
);
36+
}

0 commit comments

Comments
 (0)