Page Templates

Page templates go in your pages directory (or whatever you’ve defined as the pages_dir in your manifest.toml), and are .liquid files.

Most pages will just render an .html file when built, at the root of your site. For instance, pages/index.liquid will become dist/index.html when built.

If you define a template field on an object type, you can use a template for each object, which will then be rendered at a subpath of the object’s name. For instance, this objects.toml definition:

[post]
title = "string"
template = "post"

Would expect you to create a file called pages/post.liquid. Instead of this file being built to dist/index.html , it will generate a folder at dist/post, containing .html files for each of the objects in objects/post. The names of these html files will correspond to the names of the posts. For instance, objects/post/01-21-2024-my-great-post.toml will be rendered to dist/post/01-21-2024-my-great-post.html using the pages/post.liquid template. dist/post.html will not be generated.