logicFields is a list of strings defining fields used in static site generation logic.
To enjoy the advanced features of Stackbit Studio, you will need to specify which fields are used in your site's logic.
Examples for logic fields:
- A field used inside logical expression such as
page.category === "news"
- A field used as an object key such as
- A field used to generate page URL path such as a slug field
- A field whose value is an image that is going through image processing:
You don't need to specify logic fields for fields of the following types:
datetime. These fields are always considered as logic fields. Only fields of types
url should be specified as logic fields.
logicFields: - page.category - post.slug
The logic fields consist of three parts - the
field_path, and the
field_name, and are specified using the following format (square brackets "" indicate optional parts):
field_name(required) - the name of the field
model_name(optional) - the name of the model containing the field
field_path(optional) - the path to the field within the model
If you specify a
model_name, any field having this name across all models will be considered as a logic field.
A logic field can use all the three parts to specify a particular field of a specific model under a particular field path:
logicFields: # model┆ field┆ field # name ┆ path ┆ name # ┌────┐┆┌────┐┆┌───┐ - config.header.style
If the logic field is a direct child of the model, the field path can be omitted:
logicFields: # model┆ field # name ┆ name # ┌────┐┆┌───────┐ - config.siteTitle
Or it can specify only the field name, in which case any field with that name will be considered as a logic field:
logicFields: # field name # ┌──┐ - slug