Skip to main content

Module schema_fields

Module schema_fields 

Source
Expand description

Builtin frontmatter field definitions.

This module is the single source of truth for all frontmatter fields that moss recognizes. The schema returned by [schema::builtin_schema()] is generated from the BUILTIN_FIELDS table, not from a hand-maintained JSON file. This eliminates drift between the build pipeline’s FrontMatter struct and the editor/validation schema.

§Adding a new field

  1. Add the field to the FrontMatter struct in src-tauri/src/build/generator/markdown.rs.
  2. Add a corresponding entry to BUILTIN_FIELDS in this file.
  3. Run cargo test — the sync test in markdown.rs will fail if you forget either side.

§skip_schema fields

Fields with skip_schema: true exist in the FrontMatter struct (the build pipeline uses them) but are not exposed in the editor form or validation schema. These are typically site-level config fields read only from the homepage, auto-generated fields, or fields that will migrate to plugin- contributed schemas.

Structs§

BuiltinField
A builtin frontmatter field definition.

Constants§

BUILTIN_FIELDS
All builtin frontmatter fields recognized by moss.