Alcove CMS
Ru

Part I, Basics

Placeholders and filters

Escaped by default, chained left to right.

A placeholder is a name in double braces. {{ title }} is a value from the row, {{ page.title }} a value of the page, {{ site.url }} the address from the site settings, {{ alcove:name }} another alcove and {{ tiles }} the rendered rows.

Every value is HTML-escaped. Filters follow a | and run from left to right:

FilterEffect
upper, lowerChange case
truncate:NCut to N characters and add ...
splitSplit a comma separated value into a list
chip, chip:classWrap every item in a span
rawDo not escape. Meant for fields declared as type: html

The live result runs every filter on the one row below and shows what came out.

Live result This page is a static file, built once.

Written in the templateShown
{{ title }}the age of innocence
{{ title|upper }}THE AGE OF INNOCENCE
{{ blurb|truncate:32 }}Old New York, an engagement and ...
{{ tags|split }}novel, new york, 1920
{{ tags|split|chip:tag }}novelnew york1920
{{ note }}<em>Pulitzer Prize</em>, 1921
{{ note_html|raw }}Pulitzer Prize, 1921

Source the files behind the result above

content/alcoves/demo_filters/alcove.yaml

fields:
  - name: title
    type: text
  - name: blurb
    type: textarea
  - name: tags
    type: text
  - name: note
    type: text
  - name: note_html
    type: html
data:
  - title: the age of innocence
    blurb: Old New York, an engagement and a countess who does not follow the rules.
    tags: novel,new york,1920
    note: "<em>Pulitzer Prize</em>, 1921"
    note_html: "<em>Pulitzer Prize</em>, 1921"

content/alcoves/demo_filters/blueprint.html

<table class="filter-table">
  <thead><tr><th>Written in the template</th><th>Shown</th></tr></thead>
  <tbody>
    <tr><td><code>&#123;&#123; title &#125;&#125;</code></td><td>{{ title }}</td></tr>
    <tr><td><code>&#123;&#123; title|upper &#125;&#125;</code></td><td>{{ title|upper }}</td></tr>
    <tr><td><code>&#123;&#123; blurb|truncate:32 &#125;&#125;</code></td><td>{{ blurb|truncate:32 }}</td></tr>
    <tr><td><code>&#123;&#123; tags|split &#125;&#125;</code></td><td>{{ tags|split }}</td></tr>
    <tr><td><code>&#123;&#123; tags|split|chip:tag &#125;&#125;</code></td><td>{{ tags|split|chip:tag }}</td></tr>
    <tr><td><code>&#123;&#123; note &#125;&#125;</code></td><td>{{ note }}</td></tr>
    <tr><td><code>&#123;&#123; note_html|raw &#125;&#125;</code></td><td>{{ note_html|raw }}</td></tr>
  </tbody>
</table>