Skip to content

Instantly share code, notes, and snippets.

@rasteiner
Created January 31, 2022 14:44
Show Gist options
  • Save rasteiner/4a41b72a43675dbcfe68ba1e45bbf8bb to your computer and use it in GitHub Desktop.
Save rasteiner/4a41b72a43675dbcfe68ba1e45bbf8bb to your computer and use it in GitHub Desktop.
Kirby page blueprint schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "getkirby.com/schema/v3/blueprints/page",
"type": "object",
"$defs": {
"tabs": {
"type": "object",
"description": "Tabs are used to group related content. They can be used to create a tabbed navigation.",
"additionalProperties": {
"$ref": "#/$defs/tab"
}
},
"tab": {
"type": "object",
"description": "A tab is a single tab in a tabbed navigation.",
"properties": {
"columns": {
"$ref": "#/$defs/columns"
},
"sections": {
"$ref": "#/$defs/sections"
},
"fields": {
"$ref": "#/$defs/fields"
}
},
"oneOf": [
{
"required": [ "sections" ]
},
{
"required": [ "columns" ]
},
{
"required": [ "fields" ]
}
]
},
"columns": {
"type": "array",
"description": "Divide sections onto separate columns.",
"items": { "$ref": "#/$defs/column" }
},
"column": {
"type": "object",
"properties": {
"width": {
"description": "The width of the column expressed as a fraction",
"enum": ["1/1", "1/2", "1/3", "2/3",
"1/4", "2/4", "3/4",
"1/5", "2/5", "3/5", "4/5",
"1/6", "2/6", "3/6", "4/6", "5/6"]
},
"sections": {
"$ref": "#/$defs/sections"
},
"fields": {
"$ref": "#/$defs/fields"
}
},
"oneOf": [
{
"required": [ "sections" ]
},
{
"required": [ "fields" ]
}
]
},
"sections": {
"type": "object",
"description": "Sections",
"additionalProperties": {
"$ref": "#/$defs/section"
}
},
"section": {
"type": "object",
"description": "A section",
"properties": {
"type": {
"type": "string",
"description": "The type of section"
},
"headline": {
"type": "string",
"description": "The headline of the section"
}
}
},
"fields": {
"type": "object",
"description": "A collection of form fields",
"additionalProperties": {
"$ref": "#/$defs/field"
}
},
"field": {
"type": "object",
"description": "A form field",
"properties": {
"type": {
"type": "string",
"examples": ["blocks", "checkboxes", "date", "email", "files", "gap", "headline", "hidden", "info", "layout", "line", "list", "multiselect", "number", "pages", "radio", "range", "select", "slug", "structure", "tags", "tel", "text", "textarea", "time", "toggle", "url", "users", "writer"],
"description": "The type of field",
"oneOf": [
]
},
"label": {
"type": "string",
"description": "The label of the field"
},
"placeholder": {
"type": "string",
"description": "The placeholder of the field"
},
"help": {
"type": "string",
"description": "Help text for the field"
},
"required": {
"type": "boolean",
"description": "Whether the field is required"
}
}
}
},
"properties": {
"tabs": {
"$ref": "#/$defs/tabs"
},
"sections": {
"$ref": "#/$defs/sections"
},
"fields": {
"$ref": "#/$defs/fields"
}
},
"oneOf": [
{
"required": [ "tabs" ]
},
{
"required": [ "columns" ]
},
{
"required": [ "sections" ]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment