Replace the landing and pricing pages
Rewrite the example home page, add public pages from the page-shell primitives, and know what /pricing reads and what the validators enforce.
The foundation ships an example landing page at /, and its copy says the page is meant to be rewritten. /pricing is a working page that lists the plans checkout charges. This guide shows how to rewrite the landing page and explains what /pricing reads.
Before you begin
- A project that runs with
pnpm dev, and your name already insrc/config/site.ts. See Rebrand the project. - The copy for your home page in every locale you ship. English and Chinese are both required by default; see Add and change copy.
- For
/pricing: at least one active plan. See Pricing plans.
Know the pieces
| Piece | File | What it is |
|---|---|---|
| Home route | src/routes/{-$locale}/index.tsx | Loads the session snapshot and renders ExampleLandingPage for / and /zh |
| Landing component | src/components/marketing/example-landing.tsx | ExampleLandingPage, buildHomeHead and loadHomeRouteData |
| Landing copy | publicSite.landing in both messages.ts files | Title, intro, two calls to action, features, steps and the closing band |
| Public shell | src/components/marketing/public-shell.tsx | PublicMarketingShell (header, footer, skip link) and PublicPageHero |
| Layout primitives | src/components/marketing/ui/page-shell.tsx | Section, SectionHeader, Panel, PanelGrid, Eyebrow, PageTitle, ArrowLink, Screenshot, CommandLine, FactList, PageContainer |
| Pricing page | src/components/marketing/pricing-plans-page.tsx | PricingPlansPage, rendered by src/routes/{-$locale}/pricing.tsx |
| About and contact | src/components/marketing/localized-pages.tsx | Two short pages built the same way; copy them for new pages |
Rewrite the home page
Start with the copy
Edit publicSite.landing in src/i18n/locales/en/messages.ts and in src/i18n/locales/zh/messages.ts. If the existing structure (a hero, a feature grid, three steps and a closing call to action) suits your product, changing these strings is the whole job. Set seo.home.title and seo.home.description in the same files for the page's <title> and share card.
Change the layout in example-landing.tsx
Compose bands from the primitives. Section is one full-width band. tone="stage" gives it the muted background, and bands alternate between page and stage. tone="inverted" is for a single closing band.
<PublicMarketingShell locale={locale}>
<PublicPageHero
actions={
<ButtonLink href={localizedPath("/auth/sign-up", locale)} variant="primary">
{copy.primaryCta}
</ButtonLink>
}
copy={copy.copy}
eyebrow={siteConfig.name}
title={copy.title}
/>
<Section tone="stage">
<div className="grid min-w-0 gap-8">
<SectionHeader eyebrow={copy.featuresEyebrow} title={copy.featuresTitle} />
<PanelGrid columns={3}>
{copy.features.map((feature) => (
<Panel key={feature.title}>
<h3 className="m-0 text-base leading-6 font-semibold">{feature.title}</h3>
<p className="m-0 text-sm leading-6 text-muted-foreground">{feature.body}</p>
</Panel>
))}
</PanelGrid>
</div>
</Section>
</PublicMarketingShell>Buttons come from @/components/motion/button (Button, ButtonLink). Build every internal link with localizedPath(path, locale) so /zh pages link to /zh pages. Style with Tailwind utilities on the product tokens (text-muted-foreground, border-border, bg-card); see Use the design system.
Keep the file, the exports and the two links
Several validators read this page. They stay green when you:
- keep the component in
src/components/marketing/example-landing.tsx, exported asExampleLandingPage, withloadHomeRouteDatanext to it, and keep the home route rendering it; - read copy with
getMessageNamespace(locale, "publicSite").landing; - keep a link to
/auth/sign-upand one to/pricing; - render the site name,
title,primaryCta,secondaryCta, everyfeatures[].titleand every entry ofsteps.
If your design drops the feature grid or the steps, remove those keys from both dictionaries and update the expected list in scripts/validate/example-landing.ts in the same change. Do not leave a validator asserting copy the page no longer renders.
Show account controls to a signed-in visitor
The home route is the only public page that loads the session. loadHomeRouteData() returns the session user, whether they can open /admin, and their credit balance. ExampleLandingPage passes a PublicAccountMenu to the shell's account prop, which replaces the sign-in and sign-up buttons. Leave account unset on other public pages so they stay anonymous and cacheable.
Add another public page
- Add copy under a new namespace in both
messages.tsfiles, the wayaboutPageis defined. - Add a component next to
AboutMarketingPageinsrc/components/marketing/localized-pages.tsx(or in its own file undersrc/components/marketing/): aPublicMarketingShellaround aPublicPageHeroand one or moreSections. - Add the route by copying
src/routes/{-$locale}/about.tsxand changing the path increateFileRoute("/{-$locale}/about"). - Add the path to
publicSeoRoutesinsrc/server/services/static-seo.service.tsso it appears in/sitemap.xml. - To put it in the header, add an entry to
publicNavigationinsrc/components/marketing/public-shell.tsxand a matching label underpublicSite.navigationin both dictionaries. Footer links are in the same file. - Run
pnpm devonce sosrc/routeTree.gen.tspicks up the route.
Know what /pricing reads
/pricing has no plan data in code. Its loader calls getMarketingSite() for the current locale and keeps the plans whose status is active. Those rows come from the pricing_plans table, one per plan and locale, and you edit them at /admin/plans.
| On the page | Comes from |
|---|---|
| Plan name, description, features, button label | The plan's row for the current locale |
| Price | That row's priceCents and currency, formatted for the locale |
| Interval line | publicSite.pricing.intervals (month, year, lifetime, one_time) |
| "credits included" line | includedCredits, shown when it is above zero |
| Heading, intro, empty state | publicSite.pricing in the dictionaries |
A plan's button posts to /api/billing/checkout. The server re-prices the plan and sends the browser to the provider's checkout. A signed-out visitor is sent to sign in and returned to /pricing. Any other failure lands on /system/payment-failed with the reason. /app/billing/upgrade offers the same plans to signed-in users.
To change what is for sale, edit plans in the console. To restyle the page, edit PricingPlansPage but keep requestCheckout() as the only way a button starts a purchase. With no active plan the page shows only the publicSite.pricing.empty line.
Follow the rules the validator enforces
pnpm validate:example-landing reads example-landing.tsx and pricing-plans-page.tsx and fails when either file:
- imports from
src/components/ui(shadcn); - hard-codes a colour (
#hex,rgb(orhsl(); - uses a
ds-,mk-ords-mk-class name. Theds-mk-*marketing namespace is retired. Do not bring it back, and do not carry over class names from whatever tool generated a design; - uses an inline
style={{ … }}; - does not render inside
PublicMarketingShell.
A public page declares no tokens of its own. If a colour is missing, add or change a token on :root in src/styles/app.css so every surface gets it. The same validator also follows every link the landing, the pricing page and the shell render, and every path in publicSeoRoutes, and fails on one that reaches no route file.
Verify
pnpm validate:example-landing
pnpm validate:marketing
pnpm validate:route-i18n
pnpm validate:app-i18n
pnpm validate:mobileThen open / and /zh in the light and dark theme, at phone width and desktop width. Open /pricing signed out and click a plan. You are sent to sign in and then returned to /pricing.
Next steps
Rebrand the project
Replace the Kernlift name, URL, description, icons and share image with your own, and choose where people land after signing in.
Use the design system
Build or restyle a screen with beUI, the motion components and the product tokens, change the theme, and avoid the imports the validators reject.