{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.simplycod.com/schemas/starter-kit-v1.json",
  "title": "SimplyCod Starter Kit v1",
  "type": "object",
  "additionalProperties": false,
  "required": ["format", "schema_version", "id", "name", "version", "pages"],
  "properties": {
    "format": {"const": "simplycod-starter-kit"},
    "schema_version": {"const": 1},
    "id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$"},
    "name": {"type": "string", "minLength": 1, "maxLength": 120},
    "description": {"type": "string", "maxLength": 500},
    "author": {"type": "string", "maxLength": 120},
    "homepage": {"type": "string", "format": "uri"},
    "source_reference": {"type": "string", "format": "uri"},
    "studio_only": {"type": "boolean"},
    "installable_with": {"type": "string"},
    "version": {"type": "string", "minLength": 1, "maxLength": 30},
    "min_plugin_version": {"type": "string"},
    "home": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$"},
    "media": {
      "type": "object",
      "propertyNames": {"pattern": "^[a-z0-9][a-z0-9_-]*$"},
      "additionalProperties": {"type": "string", "pattern": "^media/[A-Za-z0-9][A-Za-z0-9._-]*\\.(jpg|jpeg|png|gif|webp|avif)$"}
    },
    "pages": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["key", "title", "slug", "layout"],
        "properties": {
          "key": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$"},
          "title": {"type": "string", "minLength": 1},
          "slug": {"type": "string", "minLength": 1},
          "status": {"enum": ["draft", "publish"]},
          "layout": {
            "oneOf": [
              {"type": "string", "pattern": "^pages/[A-Za-z0-9][A-Za-z0-9_-]*\\.json$"},
              {"type": "object", "required": ["sections"]}
            ]
          }
        }
      }
    },
    "menu": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {"type": "string"},
        "items": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
      }
    },
    "design": {"type": "object"},
    "header": {"type": "object"},
    "footer": {"type": "object"}
  }
}
