CMS and publishing

STXT as the source format of a website, a blog or a book: the content lives in text files and the presentation is decided afterwards.

This portal is built that way. Each page of stxt.dev is an STXT document of the dev.stxt.website namespace, and a generator turns it into HTML. It can be checked by adding .stxt to the address of any page, for example use-cases-cms.stxt.

A page

Page (com.acme.cms.page):
	Title: About STXT
	Slug: about-stxt
	Language: en
	Status: Published

	SEO:
		Description: A readable, validatable text language
		Keywords:
			Keyword: stxt
			Keyword: documents

	Content >>
		## What is STXT?

		STXT is a language designed for writing documents
		that people read and programs process.

		## Principles

		- Human First
		- Minimal syntax
		- Optional validation

	Footer >>
		Last updated: January 2026

In this example we have:

  • Metadata: Title, Slug, Language, Status and SEO. They are nodes the generator reads directly.
  • Content: Content and Footer. They are block nodes, and the document contains no HTML, CSS or layout.

The template

Template (@stxt.template): com.acme.cms.page
	Structure >>
		Page:
			Title: (1)
			Slug: (1)
			Language: (?) ENUM [es, en, fr]
			Status: (1) ENUM [Draft, Published, Archived]
			SEO: (?)
				Description: (?)
				Keywords: (?)
					Keyword: (+)
			Content: (1) MARKDOWN
			Footer: (?) TEXT

The template guarantees what the generator needs in order to work: a title, a slug, a status from the list and a content.

Content is of type MARKDOWN (STXT-SCHEMA-SPEC §9.7). STXT does not interpret that Markdown: it hands it over as is, and the type tells whoever receives it (the generator, the editor or the playground) how to treat it. Footer is TEXT, and it is shown literally. One lesson written with Frontmatter, MDX, Markdoc, YAML and STXT, and what each one validates: STXT, prose inside structure.

A page that does not validate

# ERROR: this document does not validate
Page (com.acme.cms.page):
	Title: About STXT
	# `Slug` is missing
	# Lowercase `published` is not `Published`
	Status: published
	# `Author` is not in the template
	Author: Joan Costa
	Content >>
		## What is STXT?

A page that does not validate is not generated.

A book in chapters

A long publication follows the same pattern. Each chapter is a node with its number and its text:

Publication (com.acme.editorial.publication):
	Title: STXT, the book
	ISBN: 978-1-23456-789-0
	Language: en
	Status: In Progress

	Chapter: Introduction
		Number: 1
		Content >>
			This chapter introduces the basic concepts of STXT.
	Chapter: Syntax
		Number: 2
		Content >>
			The syntax of the language is described with examples.
	Chapter: Validation
		Number: 3
		Content >>
			Templates and schemas add semantic rules.

And its template:

Template (@stxt.template): com.acme.editorial.publication
	Structure >>
		Publication:
			Title: (1)
			ISBN: (?)
			Language: (1) ENUM [es, en, fr]
			Status: (1) ENUM [In Progress, Published]
			Chapter: (+)
				Number: (1) NATURAL
				Content: (1) MARKDOWN

An STXT document is an ordered tree, so the chapters come out in the order in which they are written. A book of forty chapters can be split into forty files with the same namespace, and the template works for all of them.

The publishing flow

  1. The document is written with any editor.
  2. It is kept in a repository. The editorial review is a diff.
  3. It is validated with stxt validate (The command line), locally or in continuous integration.
  4. The generator reads the tree and produces HTML, PDF, EPUB or a feed.

The presentation is decided in step 4, and it can be changed entirely without touching the content.

Limits

STXT is not a CMS: it has no editing interface, users, approval workflow or preview. It is the format in which the content is stored.

It does not define which Markdown dialect is accepted in a MARKDOWN block either. That is decided by whoever renders it.

Pages can also be written by a model, see AI and LLMs.