Editing / Options
Input Options
Hidden Fields
Control which front matter fields your editors see with the hidden option.
_options:
layout:
hidden: true
Hidden fields can be edited with modal-style Editor Links.
Alternatively, hide front matter fields by prefixing the key with an underscore (e.g.
_hidden_text).
Code Blocks
Change the appearance and behaviour of your front matter code blocks to fit your use case and brand.
_options:
code_block:
tab_size: 2
show_gutter: false
javascript_code_block:
tab_size: 4
theme: dawn
| Option | Values |
|---|---|
| tab_size | Integer (optional, defaults to 4) |
| theme | String, one from themes (optional, defaults to monokai) |
| show_gutter | true or false (optional, defaults to true) |
tab_size controls how many spaces lines are auto indented.
theme controls the appearance of the editor.
show_gutter toggles line numbers and code folding controls.
Array Structures
Provides initial values for newly created items in arrays. Configured globally in _config.yml or per file in front matter with a _defaults object.
For example, set the structure for new items in a gallery array with:
_array_structures:
gallery:
label: Image
icon: image
value:
image: /placeholder.png
caption:
Define multiple structures if you need editors to add different types to an array:
_array_structures:
gallery:
- label: Image
icon: image
value:
image: /placeholder.png
caption:
- label: External link
icon: link
value:
url:
title:
Alternatively, configure on a custom scope with Jekyll defaults:
defaults:
- scope:
path: ''
type: ''
values:
_array_structures:
gallery:
- label: Image
icon: image
value:
image: /placeholder.png
caption:
- label: External link
icon: link
value:
url:
title:
The label is used in the array interface to display what kind of item(s) editors can add.
The icon is a Material Design icon name for customising how the array item preview.
New array items have their keys and values populated from the value you set. If no structure is defined, new array items clone the structure from existing array items.
---
_array_structures:
gallery:
label: Image
icon: image
value:
image: /placeholder.png
caption:
gallery:
- image: /uploads/sunset-at-the-wharf.png
caption: Golden hour at the wharf
# Adding an item to the array results in this:
- image: /placeholder.png
caption:
---
Array structures also apply when editing CSV, YAML and JSON files.