Configuration
Almost all configuration values will depend on the site-template that you use. However there are a few options that are recommended to be used by templates and some that Statigen supports natively.
Statigen Site Configuration
The Statigen site configuration will be loaded from .statigen.toml
.
There are some options for the [statigen]
table that are supported
natively:
-
statigen.contentDirectory
– The name of the directory relative to the.statigen.toml
configuration file that contains the content files. Default:.
-
statigen.buildDirectory
– The name of the directory where the build outputs will be written to. Can be overwritten with the-b, --build-dir
comand-line option. Default:build
-
statigen.template
– The name of the Statigen site-template. Can also be the relative path to a Python script. Defaults todefault/docs
. -
statigen.contentLoader
– The full Python class name for the content-loader. Default:statigen.MarkdownTomlContentLoader
-
statigen.contentRenderer
– The full Python class name for the content-loader. Default:statigen.MarkdownJinjaContentRenderer
-
statigen.templateRenderer
– The full Python class name for the template renderer. Default:statigen.JinjaTemplateRenderer
-
statigen.urlFormat
– The URL format to use, can be eitherfile
ordirectory
. Indirectory
mode, clean URLs will be generated but the generated site can not be properly used without an HTTP server that tries index-files. Infile
mode, URls to other pages will link directly to the.html
file. Default:file
-
statigen.contentEncoding
– A hint to the content loader for the encoding that the content files use. Default:utf8
-
statigen.siteEncoding
– Write HTML files in this encoding. Default:utf8
Content Configuration
The way content is configured depends on the content-loader in place. The
default content-loader allows a TOML section at the top of the file enclosed
by the three characters +++
.
+++
title = "Home"
ordering = 0
+++
Welcome!
There are no minimum number of properties that content can provide and the interpretation of these values is solely up to the site-template. However, there are a few properties that are commonly used in templates:
-
title
– The human-readable name of the content/page. -
ordering
– In a context where order is important for the content, this property is usually used to sort the content in ascending order, falling back to the title or content name. -
renderTitle
– If the title would be rendered automatically by the template, this option can be set tofalse
to disable the default title rendering. -
displayPostsFrom
– Site-templates that represent a blogging format should consider this configuration value that will mark a page generated by this content as containing blog posts from the specified directory. -
url
– Some site-templates may allow the user to specify custom URL for the page generated by the content. Some templates may also use this to determine the index-page by finding the page whereurl = "/"
.