Writing a page in Google Docs

On a site kept in Google Drive, every page is a Google Doc in content/pages. You write it as any Doc: SeedPage reads it when it builds and turns it into the page. The same page can also be changed in SeedPage's editor, which writes the same Doc.

The name and the title

  • The Doc's name is the page's address: a Doc named Opening hours is published at /opening-hours/, inside the address of its folder. Renaming the Doc changes the address.
  • A Doc named index is the page of its folder: content/pages/menu/index is /menu/.
  • The first Heading 1 is the page's title: in the browser tab, in search results, in menus. Write one, at the top or inside the first component, such as a hero.

Text

Paragraphs between tables are text. Headings (Heading 2 to Heading 6), bulleted lists, bold, italic, underline and links are kept. Colours, fonts, sizes and alignment are not: the theme decides how text looks, the same on every page.

Components are tables

Everything else on a page is a component: a hero, cards, a gallery. In a Doc, a component is a table, and the text of its first cell names it.

hero

[an image]

Find your trail. Guided trips for every level.

Explore trips

Insert, Table, and write the component's name in the first cell of the first row; the rest of that row stays empty. The rows below hold its fields. Each component's page in the catalog has its exact table, ready to copy.

Variants

A variant changes how a component looks. Write it in parentheses after the name, several separated by commas: hero (dark), cards (wide, dark). The catalog lists each component's variants, and a theme may add its own.

Rows

Most components take their fields in one of two ways:

  • Keyed rows: the first cell is the field's key, the second its value. A row per field, in any order, and fields left out take their default.
  • Rows in order: the cells follow the order of the fields, without keys. Components made of repeated things, such as cards or questions and answers, take a row per thing.

code

code

npm start

language

Terminal

Field names in a component's catalog page give each key.

Images

Put an image in a cell with Insert, Image, as in any Doc. A cell holding only one image is an image field. Its description for people who cannot see it is the Doc's alt text: right-click the image, Alt text. Leave it empty only for an image that adds nothing to the words.

The image is published in a smaller WebP, at the sizes the page needs; a large photo is fine.

  • To a page of the site: Insert, Link, and choose the page's Doc (or paste its address in Google Docs). SeedPage keeps the link to that Doc and writes the page's address, so it still works after the page is renamed or moved.
  • To another site: the full address, https://. An e-mail or a telephone: mailto: or tel:.
  • A cell holding only a link is a link field: its text is the words, its address the link.

Lists in a cell

Some fields take a list, such as a menu's links or a card's points: a bulleted list in the cell, one item per line. An indented item is a sub-item where the component has them, as in a menu.

Empty cells

An empty cell is a field left empty: the component leaves out that part. Keep the cell, so the cells after it stay in their place.

Fragments

A fragment, such as a promotion shared by several pages, is placed with a fragment table: fragment in the first cell, and a link to the fragment's Doc in content/fragments in the row below.

fragment

Summer promotion

Containers

A one-cell table holding only a name, such as main, marks where a container of the template starts. Components after it go into that container. See Containers in a Doc for when and how.

What SeedPage adds

When SeedPage first edits a page, it gives each component table a name of its own, a named range, which Docs keeps out of sight. Leave them: they are how the width and other settings of each component stay with it. See Component identity in a Doc.

When something goes wrong

  • "There is no component": the first cell is not the name of a component. Check the spelling against the catalog.
  • "The component has no variation": a variant in the parentheses is misspelled, or is not one of that component's.
  • A field is missing on the page: the cells are in another order than the component expects, or a key is misspelled.
  • "The page has no Heading 1, so it has no title": make the title a Heading 1, from the style menu next to the font.