When an editor creates an entry, Pages CMS names the file from the collection's filename template. The default is:

filename: '{year}-{month}-{day}-{primary}.md'

A post titled "Hello world" created on 1 March 2026 becomes 2026-03-01-hello-world.md. With format: json, yaml or toml, the default extension is .json, .yml or .toml instead.

By default, the template starts in the folder where you select New entry. Start the template with / to use the collection’s configured path from any folder. Slashes between segments create subfolders. Field values are slugified, so a title such as News / Updates contributes the single segment news-updates. Changing the template affects future entries.

Common templates

Template Result
'{primary}.md' hello-world.md
'{year}-{month}-{day}-{primary}.md' 2026-03-01-hello-world.md
'{sku}.json' abc-123.json, from the sku field

Page bundles and date folders

For a Hugo section, set filename: '{primary}/_index.md' and view: {layout: tree, node: _index.md}. With French selected and filename-suffix localization, creating “About” in content/pages writes content/pages/about/_index.fr.md. Open the About row in the tree to edit it.

For a date archive, anchor the template at the collection root so editors can create a post from any year or month folder.

path: content/posts
filename: '/{year}/{month}/{year}-{month}-{day}-{primary}.md'

With this template, creating “Hello” on 27 November 2026 from content/posts/2026 writes content/posts/2026/11/2026-11-27-hello.fr.md when French filename-suffix localization is active.

Use a flat template for collections with subfolders: false. Each generated path segment must be non-empty. A second leading slash, backslashes, and . or .. segments are invalid.

Tokens

Token Value
{primary} The entry's primary field, slugified: view.primary, otherwise title, name or label, otherwise the first text, number or date field
{slug} Same as {primary}
{<field>} or {fields.<field>} Any field's value, slugified
{year}, {month}, {day} Creation date, zero-padded
{hour}, {minute}, {second} Creation time, zero-padded

Let editors change the filename

Use the object form to show a filename input:

filename:
  template: '{primary}.md'
  field: create
  • false (default): hidden.
  • create: shown only when creating an entry.
  • true: shown when creating and editing. Editing it renames the file.

An explicitly entered filename is a single filename in the selected folder. The rename field also accepts a single filename.