Alcove CMS
Ru

Documentation

Everything Alcove does, with a demo

Everything Alcove does, in twenty-three short sections. Each one ends with a live demo running on this server.

An open ledger on a desk with a quill, an inkwell and a sealed letter

Quick start

A site in three steps

Alcove is one Go program with no other runtime. SQLite is built in.

  1. (I)

    Build the binary

    In the Alcove source folder, with Go 1.27:

    go build -o alcove .
  2. (II)

    Write a page and its template

    mysite/content/pages/index.yaml

    slug: ""
    title: Hello
    alcove: hello

    mysite/content/alcoves/hello/blueprint.html

    <!DOCTYPE html>
    <title>{{ page.title }}</title>
    <h1>{{ page.title }}, world</h1>
  3. (III)

    Run it

    ./alcove -dir mysite/content -port 8080

    Open http://localhost:8080. Edit a file and the site rebuilds by itself.

Contents

Five parts

This list is two alcoves: the parts are inline rows in YAML, and each part includes an alcove that reads its sections from SQL with :part.

I

Basics

Pages, alcoves, tiles and the placeholders that fill them.

  1. Pages and layouts

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

  2. Alcoves and inline data

    A folder with a template and the rows it shows.

  3. Tile variants

    One row, one fragment of HTML, picked by a condition.

  4. Placeholders and filters

    Escaped by default, chained left to right.

II

Data

Rows from SQL, filtered by the address, nested, paginated and given pages of their own.

  1. Migrations and queries

    SQL files applied once, queries that make a page live.

  2. Filtering by address

    The query string narrows the rows, always as bound values.

  3. Cascading variables

    An included alcove inherits the row it was included from.

  4. Pagination

    Numbered pages for one alcove, with a pager you write.

  5. Detail pages

    Every row gets a page of its own.

  6. Feeds and file pages

    A slug with an extension is written as that file: RSS, text, anything.

III

Interaction

Forms, posts, scripts and signing in.

  1. Forms and regions

    Post to a live page and swap only the marked element.

  2. Single alcoves and dialogs

    Ask a page for one alcove, as html, text or json, and open it in a dialog.

  3. SQL posts

    One bound statement when a page receives a post.

  4. Script posts and uploads

    A trusted program reads the post as JSON and answers.

  5. Roles and sign-in

    Numeric roles, Argon2id passwords, protected pages.

IV

Delivery

Caching, assets, languages, settings and running it on a server.

  1. Caching

    Seconds on pages, alcoves and pagers, kept in memory.

  2. Assets and images

    Fingerprinted CSS and JS, images resized with srcset.

  3. Files inside an alcove

    CSS, JS and images beside the template, bundled per page, with groups and scope.

  4. Languages

    A page in another language gets its own prefix.

  5. Site settings and redirects

    site.yaml, redirects.yaml and the files Alcove writes for you.

  6. Running and deploying

    Flags, a reverse proxy and a service unit.

V

Inspection

Seeing what is wrong before and after it ships.

  1. Validation

    One check before every build reports every problem it finds.

  2. The debug view

    Outlines, timings and SQL for every alcove, behind a key.