For developers

SeedPage is a CMS whose output is static HTML. There is no server at request time: the site is built from its pages and settings, and the files are served by a CDN. This page explains the model; the code is on GitHub.

Where a site lives

A site is a folder of readable files, a GitHub repository, or a folder in Google Drive, behind one storage interface. In a folder or repository, pages are JSON files and settings are JSON tables; in Drive, pages are Google Docs and settings are Google Sheets.

Site folder
conf/                  site administrators
  site                 site settings
  policies             which components each container takes
  resources            external CSS and JS, and where each loads
  templates/           one per template: template, structure, layout
content/               editors
  pages/               the page tree (index = the folder's own page)
  page-settings/       properties and layout of each page
  fragments/           shared pieces (header, footer)
  assets/              images and files
  data/                collections

Templates and containers

A template frames every page made from it. Its structure lists components in screen order: locked ones are the same on every page (a header fragment, a breadcrumb); containers marked editable are the areas where each page adds its own components, like the unlocked containers of AEM. A parent column puts a component inside a container.

Template structure
component_id | component_type | parent | editable | element | fragment
header       | fragment       |        |          | header  | header
body         | container      |        |          | div     |
menu         | fragment       | body   |          | aside   | docs-menu
main         | container      | body   | yes      | main    |
footer       | fragment       |        |          | footer  | footer

Policies say which components a container accepts, shared by every template that names them. A page holds only components; its title is its first heading.

Layout and breakpoints

Every component spans 12 columns by default. Spans, offsets and hidden breakpoints are kept per component in the layout of the page or template, and edited in the editor's Layout mode on an emulated phone, tablet or desktop. A component's style arranges things inside its box; the layout decides the box's width.

The grid follows the theme's CSS framework, with its breakpoints:

Breakpoint

Bootstrap

Tailwind

sm

576 px

640 px

md

768 px

768 px

lg

992 px

1024 px

xl

1200 px

1280 px

xxl / 2xl

1400 px

1536 px

Components

Each component is a folder: its fields, its Liquid markup, its CSS and, when it needs one, a small script that enhances it in the browser. Class names follow one convention, so themes can rely on them: name, name__part, name--variant.

Component folder
components/teaser/
  component.json   fields, variants, "extends"
  teaser.liquid    the markup
  title.liquid     one part of it
  teaser.css       styles
  teaser.js        optional browser enhancement

Components come in layers: the SeedPage core, then libraries and themes (a company's shared "commons", for example), then the site's own conf/components/. A higher layer overrides a file of a lower one, and "extends" inherits every file of another component and overrides only some, like AEM's resource super type.

conf/components/trip-teaser/component.json
{
  "extends": "teaser",
  "variants": ["featured"]
}

Liquid templates cannot run code: their output is escaped and filtered, and Drive never supplies scripts.

Themes

A theme is a folder with a theme.json manifest: design tokens (colours, fonts, spacing), the variants it adds to components, its grid and its stylesheets. A theme can extend another and change only what differs.

themes/my-theme/theme.json
{
  "name": "my-theme",
  "extends": "clean",
  "tokens": { "color-primary": "#13733e" },
  "styles": [{ "id": "main", "src": "css/main.css" }]
}

The build

The build reads the site, composes each page from its template, its components and its layout, renders the components, and writes static files: HTML pages with responsive images, a sitemap, robots.txt, structured data and a strict Content Security Policy. Only what changed is built again.

Terminal
npm test               # tests, no network
npm run build:demo     # the demo site into ./dist
npm run library -- --theme base --out dist/library