All articles
engineering notes · Prototype/demo

Generate the Page Content, Keep the Website Renderer in Control

By SyntaxLab · 2 min read

A website-generation prototype can accept natural-language briefs while using a fixed schema and curated components to produce safer previews.

Generate the Page Content, Keep the Website Renderer in Control

Asking a model to return an entire website as raw HTML creates a large surface for broken markup, unpredictable layout, and unsafe content. A more controlled pattern is to have the model return structured page content, then let ordinary application components render it.

SyntaxLab's website-generation demo follows this pattern. A visitor provides a business brief, style, language, and goal. The backend moderates the brief, requests typed content for sections such as hero, services, process, FAQs, and contact, then stores a result at a shareable demo URL for a limited period.

Model the page before generating it

The schema describes what the renderer can display: headlines, calls to action, service cards, stats, testimonials, and SEO fields. It also constrains choices such as theme, language, and icon names. The model writes content into those slots; the application's renderer owns layout, styling, and markup.

This improves consistency and makes the generated output easier to validate. It also makes the limits clear: if the schema does not have a section or interaction, the model cannot safely invent a new component on the fly.

Treat generated facts carefully

The demo prompt permits illustrative statistics and sample testimonials, and the page identifies itself as an AI-generated demo. That is acceptable for an interactive prototype, but the same content must not be represented as verified business information on a real company's public site.

Before publishing, owners need to confirm every address, price, opening hour, credential, testimonial, and performance claim. Generated copy is a draft, not business data.

Build review and expiry into the lifecycle

The demo screens requests, streams partial content, and deletes generated sites after seven days. A production workflow would add business ownership, preview approval, domain and analytics setup, accessible design review, and a way to update or revoke published content.

Project evidence

The implementation is in syntaxlab-backend/src/sites.ts; rendering is handled by syntaxlab/src/components/sites/SiteRenderer.tsx, with generated site pages routed through src/routes/sites.$siteId.tsx. It is a prototype with temporary demo pages, not an automated production publishing service.