Structured Content

FOLD can publish each Markdown page as JSON as well, so an app, a kiosk or another site can read your content over HTTP. This needs content models turned on for your FOLD (FOLD_CONTENT_MODELS=on).

Page JSON

Write fields as YAML front matter at the top of a Markdown page.

---
title: Hello
published: 2026-11-28
hero: /press/cover.webp
tags: [launch, news]
---

# Hello

First post.

articles/hello.md is then also published at /_fold/content/articles/hello.json.

{
  "path": "/articles/hello",
  "fields": {
    "title": "Hello",
    "published": "2026-11-28",
    "hero": "/press/cover.webp",
    "tags": ["launch", "news"]
  },
  "markdown": "# Hello\n\nFirst post.\n",
  "html": "<h1>Hello</h1>\n<p>First post.</p>\n"
}

html is the body of the page's route. A page without front matter has empty fields. Front matter must be key: value pairs whose values are text, numbers, true or false, lists or nested pairs. Dates stay text. YAML aliases and duplicate keys fail the build. HTML pages aren't published as JSON.

Models

A model file, models/NAME.model.json, checks the front matter of the Markdown pages directly inside one folder. The folder's index.md and pages in subfolders aren't checked. NAME uses lowercase letters, digits and hyphens. The build reads the model file and doesn't publish it.

{
  "folder": "articles",
  "fields": {
    "title": { "type": "text", "required": true, "max": 200 },
    "published": { "type": "date", "required": true },
    "hero": { "type": "image" },
    "tags": { "type": "list", "of": "text" }
  },
  "sort": "-published"
}
Type Accepts
text Text, with an optional max length
number A number, with optional min and max
boolean true or false
date An ISO 8601 date such as 2026-11-28, or a date-time with Z or an offset
image The root-relative path of an uploaded image or a generated variant, such as /press/cover.webp
list A list whose items have the type named by of: text, number or date

A model has 1 to 50 fields. A field is optional unless required is true, and an empty value counts as missing. The build fails, naming the file and the field, on any of these:

sort names a text, number, boolean or date field. Prefix it with - to sort descending. Pages without a value sort last, and ties sort by path. Without sort, pages sort by path.

Lists

Each model publishes /_fold/lists/NAME.json with the fields of every page it matches. A client can show an index from one request and fetch a page's JSON when it needs the body.

{
  "model": "article",
  "entries": [
    {
      "path": "/articles/hello",
      "entry": "/_fold/content/articles/hello.json",
      "fields": { "title": "Hello", "published": "2026-11-28", "tags": ["launch", "news"] }
    }
  ]
}

Page JSON and lists belong to their release. A preview serves them under the preview URL, and a rollback restores them with the pages.

Next: Site themes