{
  "id": "siteconfig.json",
  "$schema": "http://json-schema.org/draft-04/schema",
  "title": "Site config",
  "description": "Configuration of a single site",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Website name"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Website title"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Website tagline"
    },
    "style": {
      "type": "string",
      "description": "Layout filter selected for the site",
      "example": "taylor",
      "default": "the-composer"
    },
    "favicon": {
      "description": "Favicon URL",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "base.json#/definitions/url"
        }
      ]
    },
    "logo": {
      "description": "SVG logo URL",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "base.json#/definitions/url"
        }
      ]
    },
    "cta": {
      "type": "object",
      "properties": {
        "domain": {
          "name": "domain",
          "description": "CDN to serve the CtA from",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "base.json#/definitions/hostname"
            }
          ]
        },
        "bucket": {
          "name": "bucket",
          "description": "S3 bucket to serve the CtA from",
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "name": "version",
          "description": "CtA version to use on site",
          "example": "1.0.0",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "analytics": {
      "type": "object",
      "properties": {
        "google": {
          "name": "google",
          "description": "Google Analytics ID for the site",
          "type": [
            "string",
            "null"
          ]
        },
        "facebook": {
          "name": "facebook",
          "description": "Facebook tracking ID for the site",
          "type": [
            "string",
            "null"
          ]
        },
        "twitter": {
          "name": "twitter",
          "description": "Twitter tracking ID for the site",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "image_filters": {
      "type": "object",
      "properties": {
        "server": {
          "description": "URL to the imgflo.org server",
          "$ref": "base.json#/definitions/url"
        },
        "key": {
          "type": "string",
          "description": "imgflo API key"
        },
        "secret": {
          "type": "string",
          "description": "imgflo API secret"
        }
      },
      "required": [
        "server",
        "key",
        "secret"
      ]
    },
    "opengraph": {
      "type": "object",
      "properties": {
        "image": {
          "name": "image",
          "description": "Default image to use when sharing the website",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "base.json#/definitions/url"
            }
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "description": "Type of the website"
        },
        "appId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Facebook App ID associated with the site"
        }
      }
    },
    "content_rating": {
      "type": "object",
      "properties": {
        "adult": {
          "name": "adult",
          "description": "Whether the site contains adult content",
          "type": "boolean"
        }
      }
    },
    "collections": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "$ref": "collection.json"
      }
    },
    "color": {
      "type": "object",
      "properties": {
        "brandColors": {
          "type": "array",
          "default": [],
          "items": {
            "$ref": "base.json#/definitions/hexcolor"
          },
          "minItems": 1,
          "maxItems": 5,
          "description": "The user-selected brand colors for the site"
        },
        "brandStrength": {
          "type": "number",
          "default": 0,
          "minimum": 0,
          "maximum": 1,
          "description": "How strongly to tend towards brandColors, as opposed to content colors (adaptive)"
        },
        "lightness": {
          "type": "number",
          "default": 0.5,
          "minimum": 0,
          "maximum": 1
        },
        "saturation": {
          "type": "number",
          "default": 0.5,
          "minimum": 0,
          "maximum": 1
        },
        "rhythmicContrast": {
          "description": "The amount of color variation",
          "type": "number",
          "default": 0.5,
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "layout_spectrum": {
      "type": "number",
      "description": "Site layout spectrum",
      "default": 0.5,
      "minimum": 0,
      "maximum": 1
    },
    "typography_spectrum": {
      "type": "number",
      "description": "Site typography spectrum",
      "default": 0.5,
      "minimum": 0,
      "maximum": 1
    },
    "site_lang": {
      "type": [
        "string",
        "null"
      ],
      "description": "Primary site content langauge; ISO 693-1 format",
      "example": "ar",
      "default": "en"
    },
    "author": {
      "type": "object",
      "properties": {
        "name": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "string"
            }
          ]
        },
        "email": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "base.json#/definitions/email"
            }
          ]
        },
        "url": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "base.json#/definitions/url"
            }
          ]
        }
      }
    },
    "navigation": {
      "type": "array",
      "description": "External links to include in site navigation",
      "default": [],
      "minItems": 0,
      "uniqueItems": true,
      "items": {
        "$ref": "navigationentry.json"
      }
    },
    "profiles": {
      "type": "array",
      "description": "Social media profile links associated with the site",
      "default": [],
      "minItems": 0,
      "uniqueItems": true,
      "items": {
        "$ref": "navigationentry.json"
      }
    },
    "auto_approve": {
      "description": "Whether to publish site changes without design review",
      "type": "boolean"
    },
    "coverPrefs": {
      "name": "coverPrefs",
      "description": "Image processing to allow on the site. All default true.",
      "type": "object",
      "properties": {
        "filter": {
          "name": "filter",
          "type": "boolean",
          "description": "Allow image filtering",
          "example": true
        },
        "crop": {
          "name": "crop",
          "type": "boolean",
          "description": "Allow image cropping",
          "example": true
        },
        "overlay": {
          "name": "overlay",
          "type": "boolean",
          "description": "Allow image overlaying",
          "example": true
        }
      }
    },
    "purpose": {
      "description": "Site purposes",
      "type": "array",
      "minItems": 0,
      "maxItems": 2,
      "uniqueItems": true,
      "items": {
        "$ref": "sitepurpose.json"
      }
    },
    "content": {
      "description": "Site media content blocks",
      "type": "array",
      "minItems": 0,
      "uniqueItems": true,
      "items": {
        "$ref": "contentblock.json"
      }
    },
    "github": {
      "description": "Whether to synchronize site to GitHub",
      "type": "boolean",
      "default": false
    }
  }
}