Configuration

Last updated

Every setting the CLI reads, with its default. This page tests JSON and YAML code, a wide table that has to scroll sideways on a phone, nested lists and a checklist.

The config file#

Create acme.config.json at the root of your project:

JSON
{
  "workspace": "my-team",
  "site": {
    "handle": "acme",
    "indexable": false,
    "accent": "#2563eb"
  },
  "build": {
    "include": ["docs/**/*.md"],
    "exclude": ["docs/drafts/**"]
  }
}

The same settings in YAML, if you prefer it:

YAML
workspace: my-team
site:
  handle: acme
  indexable: false
  accent: "#2563eb"
build:
  include:
    - docs/**/*.md
  exclude:
    - docs/drafts/**

Every setting#

SettingTypeDefaultEnvironment variableApplies toNotes
workspacestringnoneACME_WORKSPACEevery commandRequired. The workspace's slug, not its display name.
site.handlestringthe space's name, sluggedACME_SITE_HANDLEpublish, previewThree to thirty lowercase letters, numbers and single dashes.
site.indexablebooleanfalseACME_SITE_INDEXABLEpublishWhether search engines may index the site.
site.accentcolour#2563ebACME_SITE_ACCENTpublishAdjusted on the site so it stays readable in light and dark mode.
build.includeglob list["**/*.md"]nonepublish, preview, checkPaths relative to the project root.
build.excludeglob list[]nonepublish, preview, checkApplied after include.

Precedence#

Settings are read in this order, later ones winning:

  1. Defaults

  2. The config file

    • acme.config.json at the project root

    • or acme.config.yaml if there is no JSON file

  3. Environment variables

    • Variables set in the shell

    • Variables from a .env file, which the CLI loads only when --env-file is passed

  4. Command-line flags

Before you publish#

  • The config file is at the project root

  • workspace is set

  • site.handle is the address you want

  • You previewed the release before making it live

Next: Publish your first site.