Brease Docs

Starter template

Small sites that follow every Brease convention, one per host. Start from one, or read it as a reference.

There are two starters, one for each host. Both are a Home, About and Contact site whose editable content all comes from Brease, with the same content and sections.

HostStarterBuilt with
Verceldesignatives/brease-v2-starter-templateNext.js 16, React 19, TypeScript, pnpm
Cloudflaredesignatives/brease-v2-starter-astroAstro, built to static files, TypeScript, pnpm

Start a site from one

  1. In Brease, create a site, choose the host and then Create my site on GitHub in the GitHub step. GitHub opens in a new tab with that host's starter, the name filled in and the owner set to the account Brease is installed on; create the repository. Brease picks up the new repository by itself; a repository that already existed is never taken for it.
  2. Connect the host in the next step. Brease sets up the project and writes its environment variables.
  3. Brease imports the first content from brease-seed/, and the site opens in the editor.

The Next.js starter

What's in it

src/
  app/
    [[...path]]/page.tsx        every page in every locale
    [[...path]]/layout.tsx      <html lang>, LocaleProvider, site SEO defaults
    [[...path]]/not-found.tsx
    api/brease/revalidate/route.ts   called by Brease after content-only releases
    sitemap.ts, robots.ts
  brease/templates.tsx          one entry per page template
  brease/sections/              hero, features, text, closing; index.tsx renders the list
  lib/brease.ts                 the client and cached loaders
  lib/content.ts                TypeScript types matching content.schema.json
  components/                   Header, Footer, LocaleMenu
  proxy.ts                      redirects managed in Brease, applied per request
content.schema.json             page templates: home, page, global
BREASE.md                       how the site is built, for the AI
brease-seed/                    the first content, imported once
  • page.tsx resolves the path with brease.route(), loads the page, and renders templates[page.content.template]. generateStaticParams is brease.routes(), and pages revalidate every 60 seconds.
  • templates.tsx maps a template name to { render({ page, locale }), metadata?(page) }. Adding a template means adding it here, in lib/content.ts and in content.schema.json.
  • The header and footer come from the _global page and the main and footer navigations.
  • The locale menu appears only when more than one locale has content.

The Astro starter

src/
  pages/[...path].astro         every page in every locale, prerendered from brease.routes()
  pages/404.astro, robots.txt.ts, sitemap.xml.ts
  brease/templates/             Home.astro, Basic.astro; index.ts maps template names to them
  brease/sections/              the same sections; Sections.astro renders the list
  layouts/Layout.astro          <html lang>, head tags from breaseHead()
  lib/brease.ts                 the client (pinned to the Cloudflare build's commit) and loaders
  lib/content.ts                TypeScript types matching content.schema.json
  components/                   Header, Footer, LocaleMenu
scripts/redirects.mjs           writes Brease's redirects to dist/_redirects at build time
wrangler.jsonc                  the Cloudflare Worker that serves the built files
content.schema.json, BREASE.md, brease-seed/   as in the Next.js starter
  • Pages are built once per release. In the editor's preview the dev server renders every request, so edits show on the next load.
  • There's no revalidate route: every publish rebuilds the site.
  • Redirects can't run per request on static files, so the build writes them to _redirects, which Cloudflare applies.

The seed

brease-seed/ has the same layout as the .brease/ working copy. Brease imports it once, when the site is set up; after that the content lives in Brease and the folder is no longer read.

PageSlugTemplate
pg_home""home
pg_aboutaboutpage
pg_contactcontactpage
pg_global_globalglobal

On this page