Skip to content
Margo dev

Site schema

#

This schema describes the top-level site.yaml configuration used to build a linked publication: source and output paths, identity, locales, navigation, layouts, and theme settings.

Margo site configuration v1

Closed YAML/JSON configuration for a Margo documentation site.

  • asset_budget_bytes integer

    Aggregate budget for distinct source assets. Zero keeps 16 MiB. Individual source files remain capped at 16 MiB and social images at 8 MiB. Generated runtime artifacts and configured branding are excluded; process memory and final output need a separate host budget.

    Constraints
    default=0; minimum=0; maximum=268435456
  • assets string

    Whether generated pages reference copied assets or embed supported assets.

    Constraints
    enum=["local","inline"]; default="local"
  • base_path string

    Normalized public path prefix used by routes and canonical URLs.

    Constraints
    default="/"; pattern="^(|/.*)$"
  • bindings object

    Named host binding declarations keyed by semantic provider kind.

  • custom_css array

    Additional local or approved HTTPS stylesheets.

    Constraints
    default=[]
    • *
      • css_url string required
        Constraints
        minLength=1
  • frame object

    Legacy frame presentation authority; mutually exclusive with layout and shell.

    • builtin string
    • command string
    • go_module object
      • constructor string required
        Constraints
        minLength=1
      • import string required
        Constraints
        minLength=1
      • values object
      • version string required
        Constraints
        minLength=1
    • protocol string
    • values object
  • layout object | object | object

    Typed site layout and its closed kind-specific values.

    • default object
      • content object
        • layout value
          Constraints
          const="article"
      • families array
        Constraints
        minItems=1; uniqueItems=true
      • navigation array
      • pagination boolean

        Render family-local previous and next links.

        Constraints
        default=true
      • shell boolean
      • sidebar boolean
      • toc boolean
    • kind value
      Constraints
      const="article"
    • values object
      • content object
        • layout value
          Constraints
          const="article"
      • family string
        Constraints
        minLength=1
      • navigation array
      • pagination boolean

        Render family-local previous and next links.

        Constraints
        default=true
      • shell boolean
      • sidebar boolean
      • toc boolean
  • locales object
    • default string

      Canonical BCP 47 default locale.

      Constraints
      default="en"; pattern="^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$"
    • selector object

      Visible language controls; independent of canonical and hreflang metadata.

      • enabled boolean

        Show language controls for available equivalents. Omission preserves existing behavior.

        Constraints
        default=true
      • flags object

        Optional decorative local flag images keyed by supported locale. Countries are explicit consumer choices, not inferred from language tags.

    • supported array

      Unique canonical BCP 47 locales; must include default.

      Constraints
      minItems=1; uniqueItems=true
  • navigation object
    • exclude array

      Normalized glob patterns omitted from generated navigation.

      Constraints
      uniqueItems=true
    • footer_links array

      Links appended to the native site footer. Root-relative URLs include base_path.

      • *
        • href string required
          Constraints
          minLength=1
        • label string required
          Constraints
          minLength=1
        • locale string

          Optional supported BCP 47 locale. Omit for a shared destination.

    • links array

      Global docs-header destinations, independent of family navigation. Root-relative URLs include base_path.

      • *
        • href string required
          Constraints
          minLength=1
        • label string required
          Constraints
          minLength=1
        • locale string

          Optional supported BCP 47 locale. Omit for a shared destination.

    • mode string

      Navigation strategy for the configured site.

      Constraints
      enum=["file-tree"]; default="file-tree"
  • offline boolean

    Keep the generated publication independent of network fetches.

    Constraints
    default=true
  • output string

    Normalized relative directory receiving the published artifact tree.

    Constraints
    default="dist"; minLength=1
  • publication object

    Visible publication metadata formatting. Machine timestamps retain their original timezone and precision.

    • date_format string

      Optional Go time layout for visible dates. Omission preserves RFC 3339 text. Month and weekday names follow Go's English time formatting.

      Constraints
      minLength=1; maxLength=128
  • search object
    • empty_text string
      Constraints
      minLength=1
    • label string
      Constraints
      minLength=1
    • placeholder string
      Constraints
      minLength=1
  • shell object

    Legacy shell presentation authority; mutually exclusive with layout and frame.

    • builtin string
    • command string
    • go_module object
      • constructor string required
        Constraints
        minLength=1
      • import string required
        Constraints
        minLength=1
      • values object
      • version string required
        Constraints
        minLength=1
    • protocol string
    • values object
  • site object required
    • application_name string

      Application name for browser and Apple mobile metadata.

      Constraints
      minLength=1; maxLength=256
    • base_url string

      Optional absolute HTTPS origin used for canonical URLs and feeds.

      Constraints
      format="uri"; pattern="^https://"
    • description string

      Public site description used in page and social metadata.

    • hide_name boolean

      Hide visible docs-header site name beside a wordmark, retaining its accessible name.

      Constraints
      default=false
    • home string

      Markdown path below source used as the public home route.

      Constraints
      default="index.md"; pattern="^(|.*\\.(md|markdown))$"
    • icon string required

      Normalized local favicon or site icon path below the config directory.

      Constraints
      minLength=1
    • icons array

      Additional PNG, safe SVG or ICO browser icons, or PNG Apple Touch icons. Replaces the default icon link when the same path is declared with rel icon.

      Constraints
      maxItems=32
      • *
        • path string required
          Constraints
          minLength=1
        • rel string
          Constraints
          enum=["icon","shortcut icon","apple-touch-icon"]; default="icon"
        • sizes string
          Constraints
          pattern="^(any|[1-9][0-9]{0,3}x[1-9][0-9]{0,3}( [1-9][0-9]{0,3}x[1-9][0-9]{0,3})*)$"
    • logo string required

      Normalized local SVG logo path below the config directory.

      Constraints
      minLength=1
    • logo_dark string

      Optional local SVG logo for dark mode in the docs shell.

      Constraints
      minLength=1
    • name string required

      Public site name.

      Constraints
      minLength=1
    • repository_url string

      Optional absolute HTTPS source repository URL.

      Constraints
      format="uri"; pattern="^https://"
    • social_image object required
      • alt string required

        Non-empty alternative text for the social preview image.

        Constraints
        minLength=1; maxLength=160
      • path string required

        Local JPEG or PNG social preview path; Margo preserves decoded image dimensions.

        Constraints
        minLength=1
    • theme_color string

      Browser theme color as a six-digit hexadecimal color.

      Constraints
      pattern="^#[0-9a-fA-F]{6}$"
    • version string

      Optional release or development label displayed by the site shell.

      Constraints
      maxLength=64
    • webmanifest string

      Local webmanifest JSON object, up to 64 KiB, copied unchanged. Paths inside it remain consumer-owned and relative to its published location.

      Constraints
      minLength=1
  • source string required

    Normalized relative directory containing Markdown sources.

    Constraints
    minLength=1
  • theme object
    • allow_switch_theme boolean
      Constraints
      default=false
    • builtin boolean
      Constraints
      default=false
    • color_mode string
      Constraints
      enum=["system","light","dark"]; default="system"
    • name string
      Constraints
      default="modern"; pattern="^[a-z][a-z0-9_-]{0,63}$"
  • themes array

    Additional local or approved HTTPS theme entries.

    Constraints
    default=[]
    • *
      • css_url string required

        Normalized local stylesheet path or approved HTTPS stylesheet URL.

        Constraints
        minLength=1
      • name string required

        Lowercase theme identifier.

        Constraints
        pattern="^[a-z][a-z0-9_-]{0,63}$"
      • token_catalog string required

        Normalized local token catalog path.

        Constraints
        minLength=1
  • version value required

    Exact site configuration contract version.

    Constraints
    const=1

Used by

  • margo site and margo serve.
  • YAML language-server and editor associations for site.yaml.
  • margo schema site, which emits the exact embedded bytes.