Theme data
The data a .hbs theme receives on each page, in the shapes Ghost themes already read.
A Kōlea theme is a folder of Handlebars templates written the way Ghost themes are: the same file names, helper names, and data shapes, so many Ghost themes install as they are. This page lists what each template can read. It is for whoever writes or adapts your theme.
Which template, with what data
| Address | Template, first match wins | Data |
|---|---|---|
/ | home, else index | start_here, shelves, latest, post_count |
/writing | index | posts, pagination |
/about | about, page, post | post |
/<topic> | tag-<slug>, tag, index | tag, posts, pagination |
/<topic>/<slug> | post-<slug>, post | post |
/author/<slug> | author-<slug>, author, index | author, posts, pagination |
/search?q= | search, then a page in page | query, posts, pagination |
/subscribe | subscribe, then a page in page | post |
/offers | offers, then a list in page | offers, post |
/offers/<sku> | offer-<sku>, offer, then Kōlea's own page | offer, post |
| anything else | error-404, error-4xx, error | statusCode, message |
The feed, sitemap, robots.txt, and /assets/* are made by Kōlea, not the theme. There is no routes file.
The front page
start_here: featured posts, newest first, up to 12.shelves: topics set to show on the home page, busiest first, up to 8, each with its 3 newest posts.latest: the 6 newest posts.post_count: how many posts are published.
Each is empty on a new site, so wrap every section in #if.
Shapes
- post:
id,title,slug,html,excerpt,url,feature_image,feature_image_caption,featured,visibility,access,published_at,updated_at,reading_time,tags,primary_tag,authors,primary_author,hue,hue_cool,share_x_url. - tag (a topic):
id,name,slug,description,url,count.posts,hue,hue_cool. - author:
name,slug,url,profile_image,bio,count.posts. There is one author per site. - offer:
sku,title,description,excerpt,url,price(formatted),amount(minor units),currency,for_sale,notice,buyers,letters(eachheadline,body,name,rating,verified),checkout_action,copy(a published launch's sections by key),sections(eachkey,label,html). - pagination:
page,limit,pages,total,prev,next.
Globals
@site:title,description,url,logo,navigation,topics,signup_action,search_url,writing_url,about_url,social,now, and Ghost's flags.@author:name,photo,short_bio,short_bio_html,url,social.@profile:lede,what_i_do,links.@custom: your theme's settings frompackage.json.@config:posts_per_page.
Things to know
- Put the
kolea_headhelper in every page's head. It writes the title, canonical, Open Graph, and feed tags. - Subscribe forms post to
@site.signup_actionwith a field namedemail. offer_buydraws an offer's Buy form andpriceprints its price; never write the Buy form by hand.hueandhue_coolare numbers for OKLCH; set them as--hand derive colours in CSS.- Ghost features Kōlea lacks, such as comments and paid tiers, render nothing rather than breaking the page.
- A
getblock may run 10 times per page and returns at most 100 items.