Preview routes

Match a content file to the page that displays it, including translated pages.

Use studio.preview.json beside package.json when Studio needs help finding the page that displays a record. Each key is an exact website-relative content file. Its value is a local page path, or an ordered array of paths for different languages.

{
  "content/homepage/index.json": ["/", "/fr", "/de"],
  "content/artworks/alpine-echo-field.json": [
    "/artworks/alpine-echo-field",
    "/fr/artworks/alpine-echo-field",
    "/de/artworks/alpine-echo-field"
  ]
}

Start each route with a single /. Queries and fragments are allowed. External URLs, double leading slashes, backslashes, and control characters are rejected. For a website deployed under a GitHub Pages subdirectory, use the path that works in Studio’s local preview.

Studio first tries the document’s previewUrl, then its exact file mapping, then a usable document path, then collection routes and route inference. A folder’s studio.previewUrl supplies a fallback. The first available route is the default. A localized tab can select another path from the array. If Studio cannot determine the right page, Set preview page lets an editor remember a choice on their device. Read the preview walkthrough