{
  "id": "site_config_schema.json",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Site configuration file",
  "type": "object",
  "required": [ "repository", "pages" ],
  "additionalProperties": false,
  "properties": {
    "repository": {
      "description": "HTTPS url of the repository",
      "type": "string",
      "format": "uri"
    },
    "folders": {
      "type": "object",
      "default": {},
      "additionalProperties": false,
      "properties": {
        "source": {
          "description": "location of source markdown files",
          "type": "string",
          "default": "_source"
        },
        "target": {
          "description": "destination where the prepared pages should be written",
          "type": "string",
          "default": "."
        },
        "includes": {
          "description": "destination for site navigation",
          "type": "string",
          "default": "_includes"
        },
        "site": {
          "description": "site folder, usually repository name",
          "$ref": "#/definitions/pathSegment",
          "default": ""
        }
      }
    },
    "layout": {
      "description": "optional page layout name",
      "$ref": "#/definitions/pathSegment"
    },
    "navigation": {
      "description": "site navigation",
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [ "page", "linkText" ],
        "additionalProperties": false,
        "properties": {
          "page": { "$ref": "#/definitions/pathSegment" },
          "linkText": { "type": "string" },
          "home": { "type": "boolean" }
        }
      }
    },
    "pages": {
      "description": "site pages",
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [ "file", "page", "title" ],
        "additionalProperties": false,
        "properties": {
          "file": { "type": "string" },
          "page": { "$ref": "#/definitions/pathSegment" },
          "title": { "type": "string" }
        }
      }
    }
  },
  "definitions": {
    "pathSegment": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_\\-]*$"
    }
  }
}
