Meridian handbook
ReferenceConfiguration

routes.yaml

Every key of config/sites/<key>/routes.yaml: routes with their URI patterns per locale, index pages, nesting, pagination, facets, feeds, calendars and landing pages, the home page, configuration redirects and special pages.

config/sites/<key>/routes.yaml maps the site’s content types to URLs, declares its home page, configuration redirects and special pages.

home: { type: page, slug: home }
routes:
  - type: article
    uri: "/stories/{slug}"
    index: "/stories"
    paginate: 12
    facets: [theme]
    feed: { summary: standfirst }
  - type: page
    uri: "/{slug}"
    priority: 100
    nest: true
redirects:
  - { from: "/news/*", to: "/stories/{1}", status: 301 }
special:
  search: "/search"

engine-dmo dev route add routes a type with its id, and engine-dmo describe route <path> says which route answers a path. Redirects edited by staff live in the database and are managed with engine-dmo redirects. See Sites, locales and routes and Redirects and URLs.

KeyTypeDefaultMeaning
homeobjectThe home page: a type and a slug, or a singleton type alone
home.slugstringIts slug; omitted for a singleton type
home.typestringRequiredThe type of the home page’s document
redirectslist of objects[]Redirects held in configuration. A * in from is captured as {1}
redirects[].fromstringRequiredThe path or pattern
redirects[].localestringApplies in one locale only
redirects[].statusinteger301301, 302, 307, 308 or 410
redirects[].tostringThe target; omit with status 410
routeslist of objects[]The site’s routes, one per routed type
routes[].calendarobjectAn iCalendar feed of the route’s events
routes[].calendar.daysintegerHow many days ahead the calendar covers
routes[].calendar.descriptionstringThe field used as each event’s description
routes[].calendar.fieldstringThe occurrence field the calendar reads
routes[].calendar.geostringThe field used as each event’s coordinates
routes[].calendar.limitintegerThe most events in the calendar
routes[].calendar.pathmap of stringThe index path plus a tailThe calendar’s path, one string or per locale
routes[].calendar.placestringThe field used as each event’s location
routes[].calendar.titlemap of stringThe calendar title per locale
routes[].facetslist of string[]The fields an index page can be filtered by
routes[].feedobjectA syndication feed of the route’s entries
routes[].feed.bodystringThe field the full content is read from, with content: full
routes[].feed.contentstringsummarysummary (items carry their summary) or full (items carry the body as HTML too)
routes[].feed.formatslist of string[rss, atom, json]The formats served: rss, atom, json. The path serves .xml, .atom and .json
routes[].feed.limitinteger20The most entries in the feed, 1 to 100
routes[].feed.pathmap of stringThe index path plus a tailThe feed’s path, one string or per locale
routes[].feed.summarystringThe type’s summary fieldThe text field each item’s summary is read from
routes[].feed.titlemap of stringThe site name and the type’s pluralThe feed title per locale
routes[].idstringWritten for youThe element’s stable id. Written by engine-dmo check --fix; never write or change it by hand
routes[].indexanyThe index (listing) page’s path, one string or a map per locale
routes[].landingslist of objects[]Generated landing pages under the route (engine-dmo): one per place, category or month combination with enough results
routes[].landings[].categorystringThe field giving the category
routes[].landings[].contentstringA content type whose document, matched to a landing, adds editorial text
routes[].landings[].descriptionanyThe meta description pattern per locale, with {count}, {examples} and the rest
routes[].landings[].idstringWritten for youThe element’s stable id. Written by engine-dmo check --fix; never write or change it by hand
routes[].landings[].keystringRequiredThe landing family’s key
routes[].landings[].min_resultsintegerThe fewest results a landing page needs to exist
routes[].landings[].monthstringThe occurrence field giving the month, for events
routes[].landings[].placestringThe relation field giving the place
routes[].landings[].slugsmap of anyPer category value, its slug per locale
routes[].landings[].titleanyThe title pattern per locale, with {place}, {category}, {month}
routes[].landings[].urianyRequiredThe landing path under the index, with {place}, {category} or {month}
routes[].nestbooleanfalseEntries nest under their parent entry’s path
routes[].paginateintegerEntries per index page
routes[].parentobjectBuilds the entry path from a related document: relation (the relation field) and uri (the pattern)
routes[].parent.relationstringRequiredThe relation field naming the parent document
routes[].parent.urianyRequiredThe pattern, such as /{category}/{slug}
routes[].priorityinteger0Orders two patterns of one shape, lowest first, and settles check’s ambiguity error. A document is found by its stored address, so both routes keep answering for their own documents
routes[].typestringRequiredThe content type the route serves
routes[].urianyRequiredThe entry URL pattern, one string or a map per locale, with placeholders such as {slug}
specialmap of anyThe paths of the engine’s special pages, such as search: /search and sitemap: /sitemap.xml, one string or per locale