Content#
What each route returns, and how the pieces fit a page. Field-level detail is in the API reference.
The site#
/site is everything that renders around the content, in one read per page:
name,url(the site's public origin, when Velora knows it; use it for canonical URLs, the sitemap and the feed) andlanguage(a language tag such asen-GB).settings: the title, description, logo, default share image, social links, SEO defaults andtime_zone.navigation:primaryandfooter, each a list of{label, url}. Render them in order.urlis a path on the site or a full URL.categories(sections, with theirparent),entity_types, andarticle_details(below).
The front page#
/home returns the front page's sections in the order the editor chose in Velora. Render each in turn; change the order in Velora, not in code.
kind: "articles": a run ofarticles(cards).kind: "entity_type": a run ofentitiesof one type.
Each section can have a title, a path to link "more" to, and a key: the name the site gave the section, for your front end to place or style it by.
Listings#
/articles lists live articles, newest first. Filter it with:
| Parameter | Filters by |
|---|---|
category |
Section slugs. Several, comma separated, match any. |
tag |
Tag slugs, comma separated. |
type |
Article types, comma separated: type=news,race. |
author |
A writer's slug. |
entity_type + entity |
Articles about one entity: its type's slug and its own. |
detail + value |
An article detail: detail=Sponsored&value=true. A detail that links to an entity takes the entity's slug. |
match |
all (the default): an article must match every filter. any: it may match any of category, tag and type. |
Section, writer and entity pages have their own listing routes, which return the thing and its articles together: /categories/{slug}, /authors/{slug} and /entities/{type_slug}/{slug}.
Article cards (ArticleCard) carry what a list needs: title, path, excerpt, eyebrow, cover, dates, reading_minutes, category, authors, tags and details.
Paging#
Listings page two ways.
By number, for pages a reader visits: page (1 to 500) and limit (1 to 50, 12 by default; entity type indexes take up to 100, 48 by default). The answer has page, pages and total. Give each page a path (Routing).
By cursor, for "load more" and for walking the whole archive. Every /articles answer has next_cursor; pass it back as cursor for the articles after the last one you got. It is null on the last page. An ISO time works as a cursor too: cursor=2019-06-01T00:00:00Z starts with the articles published before then. Cursors go past page 500. A read with a cursor is never cached anywhere, so do not cache it yourself.
An article#
/articles/{slug} returns an ArticleDetail: everything on the card, plus
body(Portable Text),html(the same body as HTML) andword_count. Add?format=markdownformarkdowntoo. See Article bodies.authorsin full, withbio,sociallinks (a map of network to URL) and article counts.seo:title,description,image_urlandcanonical_path. Use them for the page's metadata and canonical link.entities: who and what the article is about, each with aname,path,type_slug,type_nameandimage. Only entities that have a page are listed, so every one can be a link.corrections: dated notes (at,note) to show readers.related: up to four cards from the same section.
Details#
Details are a site's own structured fields: a race's date, whether a story is sponsored, the team a rider rides for. Articles and entities both have them.
- The shape is declared once:
/sitehasarticle_details, and each entity type inentity_typeshasdetails. Each is aDetailView: itskey, itskind(text,number,date,boolean,url,choiceorlink),optionsfor a choice, and for a link, the entity type itlinks_toand whether it holdsmany. - The values are on each article (
details) and entity (fields), keyed bykey, in the declared order. A detail with no value is left out. - A
linkvalue is aLinkedEntity(id,slug,name,type_slug,path), or a list of them when the detail holds many.pathisnullwhen that entity has no page: show the name without a link.
Entities#
/entities/{type_slug}is a type's index (/riders): its entities that have a page, by number. Withviaandto, it lists instead every entity whoseviadetail links to the entitytonames, with a page or not:via=Team&to=ineoslists a team's riders./entities/{type_slug}/{slug}is one entity:name,summary,image,fields(its details),bio(Portable Text) andbio_html, a page of its articles inarticles_page(passpageandlimit), andlinked_from: the entities linking to it, grouped by type and detail (a team's riders, by Team).seo.indexsays whether search engines should index the page. Addnoindexwhen it isfalse.
Writers, sections, pages and tags#
/authorslists writers;/authors/{slug}is one writer with a page of their articles./categorieslists sections in the site's order, each with itsparentwhen it has one./categories/{slug}is a section with a page of its articles./pages/{slug}is a static page (/about):title,body,html,seo_title,seo_description,updated_at./tagslists the tags on live articles, most used first, with counts. Tags filter listings but have no page of their own.
Search#
/search?q=... finds live articles: words, "quoted phrases" and -excluded words, best match first, paged by page and limit. q is 2 to 200 characters. Search is never cached; render it per request on a route kept for your front end (Velora keeps /search by default).
This page as markdown: https://developers.velora.build/content.md