The site folder in Drive

A site kept in Google Drive is one folder. Inside it are two folders: conf, the site's configuration, for administrators; and content, what the site says, for editors. SeedPage reads only these two. Any other file next to them is left alone.

Folder
My Bistro/
  conf/
    site                 Sheet: the site's settings
    policies             Sheet: which components each container takes (optional)
    resources            Sheet: outside styles and scripts (optional)
    templates/           one Sheet per template
    models/              one Sheet per content type
  content/
    pages/               Docs: the pages; the folders are the addresses
    page-settings/       Sheets: each page's properties and layout
    fragments/           Docs: header, footer and other shared parts
    fragment-settings/   Sheets: each fragment's layout
    tags                 Sheet: the site's tags (optional)
    assets/              images and other files
    data/                collections: Sheets or JSON files
    items/               Docs: the entries of each content type

conf: the configuration

File or folder

What it is

site

The site's settings: its name, address, languages, theme and the rest of what Settings shows. A Sheet with a site tab, and an optional theme tab.

policies

Which components each container of each template accepts. Without it, every container takes every component.

resources

Styles and scripts from other addresses, and on which pages they load.

templates/

One Sheet per template, named after it (page, article, home): its template, structure and layout tabs.

models/

One Sheet per content type, such as a dish or a product: its fields and how its pages look.

content: what the site says

File or folder

What it is

pages/

One Google Doc per page. A Doc's name is its address: a Doc named Our story in pages/about is published at /about/our-story/. A Doc named index is the page of its folder: pages/about/index is /about/, pages/index the home page.

page-settings/

The same tree as pages/, one Sheet per page with the same name: its properties (template, description, date, tags, Hide from search engines) and the width of each component. SeedPage makes it the first time a page's settings change.

fragments/

Docs shared by many pages: the header, the footer, a promotion. Templates and pages place them.

fragment-settings/

The same tree as fragments/, with each fragment's layout.

tags

The site's tags: their names and, with several languages, their name in each.

assets/

Images, PDFs and other files, in folders as you like. They are published under /assets/ with the same folders.

data/

Collections, such as opening hours or a price list: a Google Sheet, or a JSON file. Components read them.

items/

The entries of content types: a folder per type, a Doc per entry. Each becomes a page of its own.

Names

  • Names become addresses in lower case, with spaces as hyphens and accents removed: Ração Premium is racao-premium.
  • A file or folder whose name starts with _ or ~ is left out: a draft, an old version, notes. It is not published and SeedPage does not list it.
  • Folders can go eight levels deep.

Languages

A site in one language keeps its pages straight in pages/. A site in several has one folder per language in pages/, page-settings/, fragments/ and data/, named by the language: pages/en, pages/pt-br. Each is published under its own address, /en/ and /pt-br/.

Who may change what

Drive's sharing decides, as for any folder: SeedPage reads and writes as the person signed in, so what Drive lets them do is what they can do in SeedPage. Sharing given to a folder also applies to everything inside it, and can be widened below but not narrowed. So:

  • Administrators: Editor on the site's folder. They change everything.
  • Editors: Viewer on the site's folder, and Editor on content. They write pages, fragments and images, and read the configuration without changing it.
  • Reviewers: Viewer on the site's folder. They see the pages and the preview, and change nothing.

Publishing is not decided by Drive: it needs access to where the site is published, such as the GitHub repository of the pages.

Making one

The easiest way is the setup wizard: choose Google Drive as the place to keep the site (see Create a site). From a terminal, a starter site can be made in your Drive with:

Terminal
npm run google -- create --starter restaurant --name "My Bistro"
  • --language pt-BR: the site's language. --also en,es: more languages.
  • --parent <folderId>: the Drive folder to make it in, instead of the top of My Drive.

The site is added to the list of sites. An existing site's folder is added there with Add existing site and its address in Drive.

When something goes wrong

  • "Folder /conf is missing" or "Folder /content is missing": it is not a site's folder, or one of the two was renamed or moved.
  • "The site has no conf/site Sheet": it is missing, or is not a Google Sheet (an Excel file uploaded as it is, for example). Open it and choose File, Save as Google Sheets.
  • A page does not appear: it is not a Google Doc (a Word file), or its name starts with _ or ~.
  • "Folders nested too deep": the folders below the eighth level are ignored. Move them up.