{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Kener Docs Configuration",
  "description": "Configuration schema for Kener documentation",
  "type": "object",
  "required": ["name", "versions"],
  "definitions": {
    "navTab": {
      "type": "object",
      "required": ["name"],
      "anyOf": [
        {
          "required": ["sidebar"]
        },
        {
          "required": ["url"]
        }
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name for the tab"
        },
        "url": {
          "type": "string",
          "description": "Optional redirect URL for tabs that navigate away instead of rendering a sidebar"
        },
        "sidebar": {
          "type": "array",
          "description": "Sidebar navigation groups for this tab",
          "items": {
            "$ref": "#/definitions/sidebarGroup"
          }
        }
      }
    },
    "navigation": {
      "type": "object",
      "description": "Top navigation configuration",
      "properties": {
        "tabs": {
          "type": "array",
          "description": "Navigation tabs",
          "items": {
            "$ref": "#/definitions/navTab"
          }
        }
      }
    },
    "page": {
      "type": "object",
      "required": ["title"],
      "anyOf": [
        {
          "required": ["content"]
        },
        {
          "required": ["slug"]
        }
      ],
      "properties": {
        "title": {
          "type": "string",
          "description": "Display title for the page"
        },
        "content": {
          "type": "string",
          "description": "Content path in docs/content (without .md). This also becomes the docs URL slug."
        },
        "slug": {
          "type": "string",
          "description": "Deprecated alias for content path; kept for migration compatibility"
        },
        "pages": {
          "type": "array",
          "description": "Nested pages",
          "items": {
            "$ref": "#/definitions/page"
          }
        }
      }
    },
    "sidebarGroup": {
      "type": "object",
      "required": ["group", "pages"],
      "properties": {
        "group": {
          "type": "string",
          "description": "Group title displayed in the sidebar"
        },
        "pages": {
          "type": "array",
          "description": "Pages within this group",
          "items": {
            "$ref": "#/definitions/page"
          }
        },
        "collapsible": {
          "type": "boolean",
          "description": "Whether the group can be collapsed. Default is false (always expanded).",
          "default": false
        }
      }
    },
    "footerLink": {
      "type": "object",
      "required": ["name", "url"],
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name for the link"
        },
        "url": {
          "type": "string",
          "description": "URL for the link"
        }
      }
    },
    "versionContent": {
      "type": "object",
      "required": ["navigation"],
      "properties": {
        "navigation": {
          "$ref": "#/definitions/navigation"
        },
        "footerLinks": {
          "type": "array",
          "description": "Links displayed in the footer/navbar",
          "items": {
            "$ref": "#/definitions/footerLink"
          }
        }
      }
    }
  },
  "properties": {
    "$schema": {
      "type": "string",
      "description": "JSON Schema reference"
    },
    "name": {
      "type": "string",
      "description": "The name of your documentation site"
    },
    "logo": {
      "type": "object",
      "description": "Logo configuration for light and dark modes",
      "properties": {
        "light": {
          "type": "string",
          "description": "Path to light mode logo"
        },
        "dark": {
          "type": "string",
          "description": "Path to dark mode logo"
        }
      }
    },
    "favicon": {
      "type": "string",
      "description": "Path to favicon"
    },
    "versions": {
      "type": "array",
      "description": "Versioned docs configuration",
      "items": {
        "type": "object",
        "required": ["name", "slug", "content"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Version display name"
          },
          "slug": {
            "type": "string",
            "description": "Version identifier (used in docs URL path)"
          },
          "latest": {
            "type": "boolean",
            "description": "Whether this version is the latest"
          },
          "content": {
            "$ref": "#/definitions/versionContent"
          }
        }
      }
    }
  }
}
