{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hub.sovereignweb.site/schema/hub-site.schema.json",
  "title": "hub-site/1: a site's entry on hub.sovereignweb.site",
  "description": "Carried by each public site as hub.json and listed in the showroom registry. Private or vault-only sites are never listed.",
  "type": "object",
  "required": [
    "schema",
    "slug",
    "name",
    "summary",
    "kind",
    "owner",
    "address",
    "vault",
    "licence",
    "status"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "hub-site/1"
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9.-]+(/[a-z0-9.-]+)?$",
      "description": "<owner>/<site>, the page path on the hub."
    },
    "name": {
      "type": "string"
    },
    "summary": {
      "type": "string",
      "maxLength": 200
    },
    "kind": {
      "type": "string",
      "description": "What the site is, in a word: Guide, Portfolio, Tool, Shop..."
    },
    "owner": {
      "type": "object",
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "team": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "session": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "address": {
      "type": "object",
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "domain": {
          "enum": [
            "own",
            "sovereignweb.site",
            "sovereignwebsite.site"
          ]
        }
      }
    },
    "repository": {
      "type": "object",
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "branch": {
          "type": "string"
        }
      }
    },
    "vault": {
      "description": "null while the site has no vault.",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "required": [
            "id"
          ],
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string"
            },
            "server": {
              "type": "string",
              "format": "uri"
            },
            "read_key": {
              "type": "string",
              "description": "Only if the owner chose to publish it."
            },
            "in_step": {
              "type": "boolean",
              "description": "Set by CI: vault and repository hold the same files."
            },
            "checked": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      ]
    },
    "licence": {
      "description": "null until stated.",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "text": {
              "type": "string"
            }
          }
        }
      ]
    },
    "versions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "version"
        ],
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "repository_commit": {
            "type": "string"
          },
          "vault_commit": {
            "type": "string"
          }
        }
      }
    },
    "template": {
      "type": "object",
      "required": [
        "copyable"
      ],
      "additionalProperties": false,
      "properties": {
        "copyable": {
          "type": "boolean"
        },
        "how": {
          "type": "string"
        }
      }
    },
    "consent": {
      "type": "object",
      "required": [
        "by",
        "date"
      ],
      "additionalProperties": false,
      "properties": {
        "by": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "status": {
      "enum": [
        "planned",
        "holding-page",
        "live",
        "retired"
      ]
    },
    "group": {
      "type": "string",
      "description": "The group it is hosted under, e.g. Artist or Demo."
    },
    "shot": {
      "type": "string",
      "description": "Screenshot path without extension: <shot>.jpg (desktop) and <shot>-phone.jpg."
    },
    "note": {
      "type": "string",
      "description": "A short, true status note shown with the site."
    }
  }
}
