pub struct BuiltinField {Show 16 fields
pub name: &'static str,
pub field_type: FieldType,
pub widget: Widget,
pub required: bool,
pub default_json: Option<&'static str>,
pub format: Option<&'static str>,
pub enum_values: Option<&'static [&'static str]>,
pub items_type: Option<FieldType>,
pub one_of_members: Option<&'static [BuiltinField]>,
pub description: &'static str,
pub label: Option<&'static str>,
pub label_key: &'static str,
pub score: u8,
pub skip_schema: bool,
pub group: &'static str,
pub file_kinds: Option<&'static [ExtKind]>,
}Expand description
A builtin frontmatter field definition.
Each entry describes a field that moss recognizes in markdown frontmatter.
The schema::builtin_schema() function reads this table to produce the
ContentSchema returned to the editor and validation engine.
Fields§
§name: &'static strField name as it appears in YAML frontmatter.
field_type: FieldTypeData type of the field.
widget: WidgetUI widget hint for the editor form.
required: boolWhether the field is required.
default_json: Option<&'static str>Default value as a JSON literal (e.g. "true", "\"list\"", "1").
format: Option<&'static str>Format hint (e.g. "date" for YYYY-MM-DD validation).
enum_values: Option<&'static [&'static str]>Allowed values for select/enum fields.
items_type: Option<FieldType>Item type for array fields (e.g. FieldType::String for tags: [...]).
one_of_members: Option<&'static [BuiltinField]>Member variants for a OneOf union field. Each member is itself a
BuiltinField (scalar field_type/widget — const-legal). Set only for
union fields (children, series); builtin_schema() recursively
materializes these into the owned FieldDefinition::one_of.
description: &'static strHuman-readable description shown in the editor form.
label: Option<&'static str>Optional human-readable label for the chip bar. When None, the frontend
falls back to using the field key. Useful for fields with unfriendly
internal names (e.g. children_depth → “Depth”).
label_key: &'static stri18n key for the chip bar label, resolved by the TypeScript registry.
Format: “chip.label field is deprecated in favour of this key.
score: u8Display score for chip bar ordering and add-property search list ordering. Lower values appear first / sort higher in the list. Formula: score = 100 - (Frequency6 + Importance4) where Frequency (0–5) = real usage frequency, Importance (0–5) = first-principles importance. 0 means unset (skip-schema fields). Typical range: 0 (title) to 100 (draft/listed/cascade).
skip_schema: boolIf true, the field exists in the FrontMatter struct but is NOT
exposed in the editor schema or validation. Used for site-level config,
auto-generated fields, and fields migrating to plugin-contributed schemas.
The field name IS surfaced to the frontend via
FrontmatterSchema::internal_fields (populated by builtin_schema()),
so the chip bar can filter these out of its render list without a
hand-maintained denylist. Adding a new skip_schema: true field here
is sufficient — no TS-side edit needed.
group: &'static strUI group for the add-property dropdown. Fields with the same group are displayed together. Empty string for skip_schema fields. One of: “This Page”, “Child Pages”, “Child Styles”, “Whole Site”. The “Other” group is handled entirely on the TS side for unknown fields.
file_kinds: Option<&'static [ExtKind]>For Widget::FilePicker fields, the extension kinds the picker should
restrict search results to (e.g. cover → image or video; logo →
image only). None means unrestricted. This is the schema-side SSOT
the chip bar reads instead of hardcoding a key -> ExtKind[] switch.