Alcove CMS
Ru

Part I, Basics

Pages and layouts

A YAML file per page, a layout alcove with nooks to fill.

A page is one YAML file in content/pages/. It says where the page lives, what it is called, which layout it uses and which alcoves go into each nook of that layout.

The layout is an alcove too. Its template is the whole HTML document, with {{ nook:intro }} wherever the page puts alcoves, and {{ page.title }} or any key from meta wherever a page value goes.

KeyMeaning
slugThe address. Empty for the front page.
titleRequired. Shown as {{ page.title }}.
alcoveRequired. The layout alcove.
nooksWhich alcoves fill which nook of the layout, in order.
metaAny extra values, for example description.
langThe language of the page. See Languages.
cacheSeconds to keep a page that is rendered on request.
accessThe role a visitor needs. See Roles and sign-in.
postSQL or a script to run when the page gets a post.
drafttrue leaves the page out of the build.

The page you are reading is the file below. The live result is an alcove that prints a few of its values.

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

page.title
Pages and layouts
page.lang
en
page.eyebrow
Part I, Basics
page.doc
pages

Source the files behind the result above

content/pages/docs-pages.yaml

slug: docs/pages
lang: en
title: Pages and layouts
alcove: docs
meta:
  description: "A YAML file per page, a layout alcove with nooks to fill."
  nav: docs
  eyebrow: "Part I, Basics"
  doc: pages
  mode: "This page is a static file, built once."
nooks:
  intro:
    - alcove: doc_pages
  live:
    - alcove: demo_pagevalues
  after:
    - alcove: doc_pages_after

content/alcoves/demo_pagevalues/blueprint.html

<dl class="facts">
  <div><dt>page.title</dt><dd>{{ page.title }}</dd></div>
  <div><dt>page.lang</dt><dd>{{ page.lang }}</dd></div>
  <div><dt>page.eyebrow</dt><dd>{{ page.eyebrow }}</dd></div>
  <div><dt>page.doc</dt><dd>{{ page.doc }}</dd></div>
</dl>