Objects.
Before your template renders, FleekSite builds a context: a set of objects describing the site, the content being rendered, the request and the environment. These are the variables every template can read.
The top-level variables are site, page and post, env, current_user, params, cookies, referer, flash, bits and bit_list, post_types, core_site_categories, time / day / month / year, image_url, browser, vapid_public_key and, when a template record is in play, template. All keys are snake_case.
site
The full site record, plus computed aliases. Common fields:
| Field | Value |
|---|---|
site.name | The site name. |
site.title | The meta title, falling back to the name. |
site.description | The meta description. |
site.keywords | The meta keywords. |
site.phone / site.mobile | The contact number. |
site.currency | The currency code, defaulting to USD. |
site.language | The language code, defaulting to en. |
site.data | A free-form object for custom site values. |
site.render_mode | The render mode, compat or standard. |
The whole record is present, so any column on the site is readable here. See Sites.
page and post
When a post is being rendered, its record is available as both page and post, and its fields are also merged at the top level, so {{ page.title }}, {{ post.title }} and {{ title }} all work. It is also aliased by its type: a product (type 3) is readable as {{ product }}. Beyond the raw columns, the object carries:
| Field | Value |
|---|---|
page.author | The author, from the linked user (a safe subset of fields, never credentials). |
page.media | The post's images, video and audio, as an array. |
page.primary_media | The lead image. |
page.variants | Product variants, as an array. |
page.tags | The tags, as an array. |
page.data / page.meta | Free-form objects for custom and SEO values. |
page.price | A two-decimal string, floored to 0.00 below one. |
page.permalink | The path, cleaned to a leading slash. |
page.comments, page.previous_post, page.next_post | Related records, when loaded. |
See Posts and types for the type list and aliasing.
env
The environment and request paths.
| Field | Value |
|---|---|
env.root_url | The site's canonical origin, for example https://yoursite.com. |
env.api_url | The API base, root_url plus /api/v1. |
env.request_path | The current path. |
env.request_paths | The path split into segments. |
env.query_string | The raw query string. |
env.image_url | The image CDN base. |
env.platform | Platform details: url, admin_url, name, email. |
env.cookies | The request cookies, as a map. |
current_user
The signed-in user, or null when nobody is signed in. Its role is the user's role on this specific site. Use it to gate content:
{% if current_user %}
Welcome back, {{ current_user.first_name }}.
{% else %}
href="/login">Sign in>
{% endif %}bits and bit_list
bits is a map of your site bits grouped by category, as { category: { name: value } }, so {{ bits.general.tagline }} reads one value. bit_list is the same data as lists, for iterating. See Bits.
Request data
| Object | Value |
|---|---|
params | The query-string parameters, as a map. {{ params.q }} reads ?q=.... |
cookies | The request cookies. |
referer | The referring URL, if any. |
flash | A one-render message map, used on error pages. |
Query parameters flow into a {% collection %} query, but a denylist of privilege and identity parameters is never taken from the URL, and visitor paging is capped. See The collection tag.
Taxonomy and time
| Object | Value |
|---|---|
post_types | The list of content type names. |
core_site_categories | The site's categories. |
time | The current time as an ISO string (UTC). |
day / month / year | The current day, month (from 1) and year. |
image_url | The image CDN base (also on env). |
browser | The request user-agent string. |
vapid_public_key | The public key for push subscription. See PWA and push. |
template | The current template record, when one is in context. |