Kernlift

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 in src/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

PieceFileWhat it is
Home routesrc/routes/{-$locale}/index.tsxLoads the session snapshot and renders ExampleLandingPage for / and /zh
Landing componentsrc/components/marketing/example-landing.tsxExampleLandingPage, buildHomeHead and loadHomeRouteData
Landing copypublicSite.landing in both messages.ts filesTitle, intro, two calls to action, features, steps and the closing band
Public shellsrc/components/marketing/public-shell.tsxPublicMarketingShell (header, footer, skip link) and PublicPageHero
Layout primitivessrc/components/marketing/ui/page-shell.tsxSection, SectionHeader, Panel, PanelGrid, Eyebrow, PageTitle, ArrowLink, Screenshot, CommandLine, FactList, PageContainer
Pricing pagesrc/components/marketing/pricing-plans-page.tsxPricingPlansPage, rendered by src/routes/{-$locale}/pricing.tsx
About and contactsrc/components/marketing/localized-pages.tsxTwo 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.

src/components/marketing/example-landing.tsx
<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.

Several validators read this page. They stay green when you:

  • keep the component in src/components/marketing/example-landing.tsx, exported as ExampleLandingPage, with loadHomeRouteData next to it, and keep the home route rendering it;
  • read copy with getMessageNamespace(locale, "publicSite").landing;
  • keep a link to /auth/sign-up and one to /pricing;
  • render the site name, title, primaryCta, secondaryCta, every features[].title and every entry of steps.

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

  1. Add copy under a new namespace in both messages.ts files, the way aboutPage is defined.
  2. Add a component next to AboutMarketingPage in src/components/marketing/localized-pages.tsx (or in its own file under src/components/marketing/): a PublicMarketingShell around a PublicPageHero and one or more Sections.
  3. Add the route by copying src/routes/{-$locale}/about.tsx and changing the path in createFileRoute("/{-$locale}/about").
  4. Add the path to publicSeoRoutes in src/server/services/static-seo.service.ts so it appears in /sitemap.xml.
  5. To put it in the header, add an entry to publicNavigation in src/components/marketing/public-shell.tsx and a matching label under publicSite.navigation in both dictionaries. Footer links are in the same file.
  6. Run pnpm dev once so src/routeTree.gen.ts picks 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 pageComes from
Plan name, description, features, button labelThe plan's row for the current locale
PriceThat row's priceCents and currency, formatted for the locale
Interval linepublicSite.pricing.intervals (month, year, lifetime, one_time)
"credits included" lineincludedCredits, shown when it is above zero
Heading, intro, empty statepublicSite.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( or hsl();
  • uses a ds-, mk- or ds-mk- class name. The ds-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:mobile

Then 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