Skip to main content
A member site’s structure lives in three files under config/. config/pages.json lists the pages, config/menus.json holds the menus, and config/settings.json holds the values your templates read as settings. This page covers what each file holds, how a page picks its layout and menu, and which changes are live at once and which wait for a publish. You edit these files in the folder the CLI pulls, or you write them through the file API: see Write a site file for members and Write a site file for company sites. The pages API changes one page at a time: see Add a page and Change a page.

Know how a page works

A page is two things:
  • A row in config/pages.json. It holds the page’s slug, title, position, published flag, layout and menu.
  • A file, pages/<slug>.liquid. It holds the page’s content. The home page’s file is pages/index.liquid.
Members are served a page only when both are ready. The row must say published: true, and the page’s content must have been published with the site. A page whose row is published but whose content was never published is missing to members, and no list of pages shows it.

Write the pages file

config/pages.json
layout at the top is the site’s default layout name, or null. Each page row holds:
  • The CLI needs four keys. A row must have slug, title, position and published. layout and menu default to null. Any other key is refused.
  • The file API needs two. Written through the file API, a row needs only slug and title. position defaults to the row’s place in the list, published to false, and layout and menu to null.
  • A site holds at most 50 pages. A new page needs a row and a file.
  • The home page is /. Its file is pages/index.liquid, which is why no other page can take the slug index. If a site has no served home page, /accounts/<site-handle> answers not found for every member, and the /accounts landing skips the site. See Sites home.
  • Rows are matched by slug. Writing config/pages.json through the file API makes the site’s pages match the file. It changes the rows it names, adds new ones with an empty file, and removes every page whose row is missing, with its content. A page you rename is a new page and a removal.
  • An unpublished page is hidden everywhere. It isn’t in site.pages, site.pages_menu or any menu, and a visitor who opens its address gets not found. A draft preview shows it.

Pick a layout

A page uses the first of these that applies:
  1. The page row’s layout.
  2. The site’s default layout.
  3. The layout named site, which is layouts/site.liquid.
The name none renders the page with no layout. A layout name the site has no published layout for falls back to the layout named site, and then to no layout when the site has none. A page never goes blank because a layout is missing. The layout prints the page where it writes content_for_layout. See Pick a layout.

Write the menus file

A menu is a list of items. A site can hold any number of menus, each with its own slug.
config/menus.json
  • A menu has a slug, a title and items. The slug is lowercase words joined by single hyphens and unique in the file. The title can’t be empty. items is optional.
  • An item has a title. It can carry a page, which is the slug of a page in config/pages.json (/ is the home page), or a url, which is an http or https address. It never carries both. An item with neither is a heading.
  • Items nest to any depth. Put children under items. The order of the list is the order members see.
  • Every other key is refused. So is an item whose page names no page of the site.
  • The file replaces every menu. Menus are matched by slug and keep their identity. A menu you leave out is deleted, and the pages that used it lose their menu. To clear every menu, write a file whose menus list is empty.
  • A link to a page the site doesn’t serve is left out, with the items under it. That includes a page that is unpublished. A heading keeps its place and has no link.

Choose which menu a page uses

A page’s templates read its menu as settings.menu. Fluid picks it in this order:
  1. The menu named in the page row’s menu.
  2. The menu with the slug main.
  3. site.pages_menu, a menu Fluid builds from the site’s served pages.
A template can also read any menu by its slug as site.menus.<slug>, such as site.menus.footer. See Read the Liquid objects for the shape of a menu. A page row can name only a menu that config/menus.json defines. Push config/menus.json before the row that names a new menu. The CLI does this for you.

Write the settings file

config/settings.json is one JSON object. Templates read it as settings, and Fluid adds settings.menu to it for the page being rendered. Use it for values such as colors and fonts that every viewer sees the same.
  • Writing the file replaces the whole object. The site’s settings field in Change a site does the same.
  • Never put a member’s data in it. The settings are the same for every viewer and are visible to every viewer.
  • It always exists. You can write it but not remove it.

Know what is live at once

Some of these files have a draft, and some don’t. A publish makes the drafts live. See Publish a site. Two things follow:
  • A new page isn’t served until you publish. Its row is live at once, but its content is a draft. Members get not found for the page until the next publish.
  • Unpublishing a page takes effect at once. Setting published to false on a page members already see removes it from the site, from its menus and from site.pages without a publish.
The CLI page lists these changes before a push writes them.