Site / Creating a site
Server rendering a route
On the server, SSR.plan selects the route and active Site.sources, pairs
them with Remote.resume(Data), and renders HTML carrying the data so the
browser resumes without re-fetching:
ts
const plan = SSR.plan(App, {
id: 'owner',
state: Projection.pick(App.model.route),
surfaces: Object.values(active),
parts: [Remote.resume(Data)],
})
const render = Effect.gen(function* () {
const rendered = yield* SSR.render(config, plan, { buildId: 'b' })
return SSR.page(template, rendered)
})SSR.inspect verifies that the plan covers every active Surface before serving,
and staticSite builds static HTML pages, sitemaps, and robots.txt at build
time.
SEO and head metadata
- Titles: Read
Site.titleOf(site, route)for your document{ title, body }, navigation bars, and breadcrumbs from one source. - Crawlable HTML: Server rendering and
staticSiteemit populated HTML alongside generated sitemaps androbots.txt. - Rich head tags: Define
meta: ({ route, model }) => Metaandindexed: falseon nodes, then passSite.metaOf(site, route, model)to your SSR plan'smetaoption fordescription, Open Graph,twitter:*,noindex, and JSON-LD tags.