FleekSiteFLEEKSITE
On this section
Platform concepts

Partials and includes.

Templates compose. A page pulls in a header, a card, a footer, each its own template. FleekSite offers the portable partial tag in every mode, and the native include and render tags once a site is on standard mode.

Your templates are your filesystem. There are no files on disk to include; a template is looked up by its title. So {% partial header %} and, in standard mode, {% include 'header' %} both resolve to the template titled header on your site.

The partial tag

{% partial %} is the portable way to include a template. It works in both render modes, so it is the safe default.

{% partial header %}

 class="content">
  {{ page.body }}
>

{% partial footer %}
  • The argument is the template title.
  • The included template renders in the current context, so it sees site, page, bits and everything else the page has.
  • A missing template renders a single space, not an error, so a stray include never blanks a page.
  • A template whose body starts with the <%= no_render %> marker is included with the marker stripped.

Native include and render

Standard mode wires the standard Liquid tags to your templates.

TagBehaviour
{% include 'name' %}Renders the template titled name in the current context, like {% partial %}.
{% render 'name' %}Renders it in an isolated context: the child sees only what you pass, not the parent's variables.

Use {% render %} when you want a clean scope and pass exactly what the child needs. Use {% include %} or {% partial %} when the child should see the whole page context. FleekSite tags inside an isolated render (a nested {% partial %} or {% collection %}) still resolve the current site correctly.

In Compat mode the native {% include %} and {% render %} render nothing, for parity with the older engine. Compose compat sites with {% partial %}. Either way, neither tag can read the server disk: an include name only ever resolves to one of your templates.

Shared templates

Most templates are private to your site. One name, mime_select, is a platform-wide template resolved from the shared site, so a reference to it is the same on every site. Regular includes never cross site boundaries.

The cycle budget

A template that includes itself, or two templates that include each other, would recurse forever. In Standard mode every include, render and partial resolution is charged against a per-request budget of 5000. A genuine page, even a long listing with nested partials, uses a few hundred at most. If a cycle blows the budget, that render stops and the page degrades to its unrendered body rather than taking the process down. The budget is shared across the whole render tree, so a cycle through any mix of tags is caught.

Template bodies are cached for about a minute, so an edit to an included template shows up within that time.

The layout tag

The standard {% layout %} tag, where a content template names a layout that wraps it, is Coming and not usable yet. For shared page chrome today, use partials, or let the platform pick a layout by content type. See Type-based layouts and the layout tag reference.