Fragments and files in Drive

Fragments

A fragment is a part shared by many pages: the header, the footer, a promotion, a contact box. On a site in Drive, each fragment is a Google Doc in content/fragments, written like a page: text and component tables, no title needed.

  • Folders inside content/fragments are only for keeping order. A fragment is known by its path: footer, or promotions/summer.
  • On a site in several languages, each language has its folder, content/fragments/en and content/fragments/pt-br, with a Doc of the same name in each. A page shows the fragment of its own language.
  • The widths of a fragment's components are in content/fragment-settings, a Sheet of the same name.

Templates place the fragments every page has, such as the header and the footer: the fragment column of the template's structure names it. A page places one of its own with a fragment table, its second row a link to the fragment's Doc:

fragment

Summer promotion

Insert, Link, and choose the fragment's Doc. A change to the fragment shows on every page that has it, at the next build.

SeedPage's Fragments section lists and makes them, and the fragment editor edits them as pages are edited.

Files: content/assets

Images and other files of the site live in content/assets, in folders as you like: photos/, team/, menus/. Upload them in Drive, or in SeedPage's Assets section.

  • Images (JPEG, PNG, WebP, GIF, SVG) chosen in image fields, or as the logo and the image for link previews, are published in smaller WebP copies at the sizes the page needs. Upload the large original; nothing is lost.
  • Other files, such as a PDF menu, are published as they are, at /assets/ followed by their folder and name: content/assets/menus/autumn.pdf is /assets/menus/autumn.pdf. Link to them from a Doc by linking the file in Drive.
  • Only files the site uses are published. A file nobody links to stays in Drive.
  • An image named favicon (favicon.png or favicon.ico) at the top of content/assets is the icon of the browser tab.

The names follow the rule of every name in the site folder: lower case, spaces as hyphens, accents removed; a name starting with _ or ~ is left out.

Images pasted in a Doc

An image pasted or inserted straight into a page's Doc does not go to content/assets: Docs keeps it inside the Doc. It is published the same way, in WebP at the sizes needed, and its description is the Doc's alt text. Use content/assets for an image used on several pages, or one people should find and replace in one place.

Sharing

Nothing in the site folder needs to be shared with the public, or as anyone with the link. SeedPage reads the files with the sign-in of the person publishing and puts copies on the published site; the originals stay as private as the folder.

When something goes wrong

  • An image does not show: the file was deleted, or moved out of content/assets. A field keeps the file itself, so renaming it or moving it between folders of assets is fine.
  • A link to a file leads nowhere: the file is outside content/assets. Move it there and link it again.
  • The favicon is not used: it is not a PNG or ICO file.