Spec: Written ahead of the package. Not in 7.0.0-alpha.0: site, sitemap7.0.0-alpha.0
Site
A Site's Pages, navigation and Brand, rendered as a folder of Page records under one Theme, with its 404, contact and terms pages.
A Site is a website as a Thing: its Pages, navigation, and Brand, served on one or more Domains.Site startupbuilder.dev
What mdxui renders
A Site is a folder of Page records that all name one Theme, plus a 404 record. Each worked Site below is one, rendered whole by @mdxui/site.
| Part | Comes from | Built by |
|---|---|---|
| Every Page under the origin | One Page record each, all naming one Theme | renderPage per record, or site.ts's render under your own Theme |
| The header on every Page | One nav section, the same on each Page | the nav Section type |
| The footer on every Page | One footer section, the same on each Page | the footer Section type |
| A 404 page | pages/harbor/404.json, the article Template | ship.ts, as dist/404.html |
| A contact page | pages/harbor/contact.json, the contact Template | the cta-form Section type, and worker.ts on /contact/send |
| A terms page | pages/harbor/terms.json, the article Template | renderPage |
sitemap.xml and robots.txt | The Pages, less the 404 and any record marked noindex | ship.ts; @mdxui/site#sitemap, intended |
| Share images | One per Page, from its meta.image | renderPage writes the tags; the images are drawn by hand, and generated images are intended |
How it maps
| startupbuilder.dev | mdxui today | Status |
|---|---|---|
Pages | One Page record per address, pages/<site>/<path>.json, rendered by renderPage | Alpha: Renders today from the published packages |
navigation | navfooterA nav and a footer section in each record | Alpha: Renders today from the published packages |
Brand | The record's theme: one of five Themes, the same on every Page | Alpha: Renders today from the published packages |
Domains | The host serves the files; Ship a Site deploys them to a Worker | Host: The job of the host that serves the files, not of the renderer |
| sites/[site]/ | A folder of JSON records in place of MDX Page files | Alpha: Renders today from the published packages |
| layout.mdx | No shared layout: each record repeats its nav and footer sections | Gap: No counterpart in the record; the intended Noun drafts one |
| [key]/ routes | No Collection route: each member is a record of its own | Gap: No counterpart in the record; the intended Noun drafts one |
| not-found.mdx | 404.json, an article record, written as 404.html | Alpha: Renders today from the published packages |
| Portal | The signed-in part belongs to the App; see App types | Study: App and View territory: studied, not designed |
the whole Site in one call | site({ origin, theme, pages }) | Spec: Written ahead of the package |
sitemap and robots | sitemap(pages); Ship a Site writes both by hand | Spec: Written ahead of the package |
Status
Every Page of a Site renders today, one renderPage call per record. A Site renders whole or not at all, so Ship a Site refuses a folder with no 404 record or with a second Theme.
// path → file: every Page as HTML, then 404.html, sitemap.xml and robots.txt
const files: Map<string, string> = site({ origin, theme, pages });
// theme: a bundled name or a Theme entry, the shape THEMES holds each Theme in
// pages: path → Page record; '/404' and '/terms' are required
// refused: a missing 404 or terms page, or a record under a second ThemeIntended Noun
The record a Site needs, drafted where today's folder of records has a gap: one header, one footer and one logo, written once.
noun: Site record
projects: startupbuilder.dev Site, quoted above; defines nothing new
fields:
origin: { type: URL, required: true }
theme: { type: Theme, required: true, note: one Theme for every Page }
pages: { type: Page, count: 1 or more, required: true }
header: { type: section, holds: nav, required: true, note: written once, drawn on every Page }
footer: { type: section, holds: footer, required: true, note: written once, drawn on every Page }
logo: { type: SVG asset path, required: false, note: drawn at the brand mark's size in the Theme's ink }
contact: { type: URL, required: false, note: the address /contact/send forwards to }
terms: { type: Page, template: article, required: true }
notFound: { type: Page, template: article, required: true }