Skip to Content

Content Schemas

A schema is a visual form template. When an editor creates a new post, the schema ensures all the right fields (Title, Date, Author, Cover Image, Tags) appear automatically.

The visual schema editor, listing a schema's fields


⚑ When Do You Need a Schema?

  • Use Schemas for Collections: Folders that regularly grow (e.g. blog/, authors/, products/, docs/).
  • Skip Schemas for One-Off Pages: Single files like homepage, about.md, or contact.md do not need schemas. Sitepins reads their existing frontmatter automatically.

Rule of thumb: Would you ever click β€œAdd New” in this folder? If yes, create a schema. If it’s a single static page, you don’t need one!


πŸ› οΈ Visual Schema Builder (3-Click Setup)

  1. Open any content folder and click Create Schema.
  2. Pick an existing Markdown file as a template.
  3. Sitepins automatically inspects your frontmatter and generates the schema fields!
  4. Customize labels, mark fields as required, or reorder them, then click Save.

Schemas are stored cleanly in your Git repository under .sitepins/schema/<folder>.json.


πŸ“‹ Supported Field Types

Field TypeBest Used For
Text & TextareaShort headings, descriptions, and summaries.
Markdown / Rich TextFull formatted body content with embeds and blocks.
NumberOrder index, pricing, ratings, or read time.
BooleanDraft switches, featured toggles, and flags.
Date & DatetimePublished dates and event timestamps.
Image & FileMedia pickers linking directly to your Media Library.
Select & Multi-SelectCategories, themes, and static dropdown choices.
Tags / String ListComma-separated tags or lists of strings.
Object & List of ObjectsComplex nested components (e.g., FAQ accordions, testimonial cards).
RelationDynamic dropdowns linking to other collections (e.g., choosing an Author for a Post).

πŸ’» Developer Reference: Schema File Format

Schemas live in .sitepins/schema/ as JSON files matching your content folder name:

{ "name": "blog", "folder": "src/content/blog", "fields": [ { "name": "title", "label": "Post Title", "type": "text", "required": true }, { "name": "date", "label": "Publish Date", "type": "date", "required": true }, { "name": "image", "label": "Cover Image", "type": "image" }, { "name": "draft", "label": "Draft", "type": "boolean", "default": false } ] }
Last updated on