Skip to content

Templating Engine

Make your Readits intelligent and dynamic using the built-in templating engine.

Readit processes all content through the Liquid templating engine before serving it. This means you can use variables and logic in any file, at any time, to generate dynamic Markdown.

This allows you to insert the current timestamp, dynamically list all files in a Readit, show conditional content based on sharing status, variables, transformation and much more.

We use Liquid syntax, see here for all details shopify/liquid

The following variables are available for each readit rendering

  • {{ now }}: Current ISO timestamp (e.g., “2025-09-17T18:30:00.000Z”).

    you can get different format using Date filter (see below)

  • {{ readit.name }}: The name of the Readit.

  • {{ readit.description }}: The Readit’s description (can be null).

  • {{ readit.slug }}: The URL slug for the Readit.

  • {{ readit.visibility }}: Visibility level (“public”, “private”, “unlisted”).

  • {{ readit.mainfile }}: The name of the root file (can be null).

  • {{ readit.files }}: An array of all file objects in the Readit.

    • Each file object contains: id, name, fileType, sizeBytes, tokenCount, summary, createdAt, updatedAt.
  • {{ file.name }}: The name of the file currently being viewed.

  • {{ file.token_count }}: Token count of the current file.

  • {{ file.size_bytes }}: Size in bytes of the current file.

  • {{ url_token }}: The sharing token for the current URL.

  • {{ expired }}: A boolean (true/false) indicating if the link has expired.

  • {{ expires_in }}: The number of seconds remaining before expiration (null if no expiration).

These are only available when the ?q= parameter is in the URL.

  • {{ search.results }}: An array of result objects.

  • {{ search.total }}: Total number of results found.

  • {{ search.query }}: The search query string used.

  • {{ search.limit }}: The results-per-page limit.

  • {{ search.offset }}: The pagination offset.

    • Each result object contains: id, filename, file_type, created_at, updated_at, rank, snippet.

you can use several control flow constructs and iterators:

if/elseif/else, case/when, unless, for loop, cycle, tablerow…

{% if product.title == "Awesome Shoes" %}
These shoes are awesome!
{% endif %}
{% for product in collection.products %}
{{ product.title }}
{% endfor %}

These are the main filters that can be useful in a readit.

{{ "/my/fancy/url" | append: ".html" }} --> /my/fancy/url.html
{{ "title" | capitalize }} --> Test
{{ now | date: "%a, %b %d, %y" }} --> Fri, Sep 19, 25
{{ product_price | default: 2.99 }}
{{ "Ground control to Major Tom." | size }}
{{ "Ground control to Major Tom." | truncate: 20 }} --> Ground control to...
{{ "Tetsuro Takara" | url_encode }} --> Tetsuro+Takara
{% assign my_array = "ants, bugs, bees, bugs, ants" | split: ", " %}
{{ my_array | uniq | join: ", " }} --> ants, bugs, bees
{{ "Ground control to Major Tom." | split: " " | first }}
{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{{ beatles | join: " and " }} --> John and Paul and George and Ringo

For all filters, you can see here shopify/liquid