{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://korczis.github.io/schemas/front-matter.schema.json",
  "title": "Front matter of a page of korczis.github.io",
  "description": "Every content/*.md carries this front matter (TOML). It drives the page's title, SEO, Open Graph and Twitter tags, OG image, JSON-LD and its place in the site; nothing about a page is typed in a template. Validated by scripts/check-front-matter.mjs.",
  "type": "object",
  "required": [
    "description",
    "template"
  ],
  "additionalProperties": false,
  "properties": {
    "title": {
      "type": "string",
      "minLength": 2,
      "maxLength": 60,
      "description": "The page's name; `<title>` is `title · Tomas Korcak` unless extra.seo_title is set."
    },
    "description": {
      "type": "string",
      "minLength": 50,
      "maxLength": 165,
      "description": "Meta description, og:description and the lead under the page header."
    },
    "template": {
      "type": "string",
      "pattern": "^[a-z-]+\\.html$"
    },
    "path": {
      "type": "string",
      "pattern": "^[a-z0-9/-]+$"
    },
    "weight": {
      "type": "integer",
      "minimum": 1
    },
    "updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
      "description": "When the subject last changed (the last commit, measured, UTC); Zola writes it as the sitemap's lastmod and the page's article:modified_time. Generators derive it; never typed."
    },
    "extra": {
      "type": "object",
      "required": [
        "og_title",
        "og_image",
        "schema",
        "keywords"
      ],
      "additionalProperties": false,
      "properties": {
        "seo_title": {
          "type": "string",
          "maxLength": 70
        },
        "og_title": {
          "type": "string",
          "minLength": 10,
          "maxLength": 90,
          "description": "Headline of the generated OG image and og:title."
        },
        "og_description": {
          "type": "string",
          "minLength": 50,
          "maxLength": 165
        },
        "og_image": {
          "type": "string",
          "pattern": "^og/[a-z0-9-]+\\.png$",
          "x-width": 1200,
          "x-height": 630,
          "description": "Generated by scripts/build-og.mjs from this front matter."
        },
        "schema": {
          "enum": [
            "home",
            "profile",
            "collection",
            "index",
            "about",
            "project",
            "term",
            "glossary"
          ],
          "description": "Which JSON-LD page type templates/partials/seo.html emits."
        },
        "category": {
          "type": "string",
          "pattern": "^[a-z]+$",
          "description": "Category pages only: a key of [categories] in data/projects.toml."
        },
        "keywords": {
          "type": "array",
          "minItems": 3,
          "maxItems": 16,
          "items": {
            "type": "string",
            "minLength": 2
          }
        },
        "repo": {
          "type": "string",
          "minLength": 1,
          "description": "Work pages only: the repository name in data/recent.json."
        },
        "viz": {
          "type": "array",
          "maxItems": 9,
          "description": "Visual cards rendered by templates/partials/viz-grid.html, in order.",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "source",
              "title",
              "lead"
            ],
            "additionalProperties": false,
            "properties": {
              "kind": {
                "enum": [
                  "atlas",
                  "constellation",
                  "experience",
                  "graph",
                  "languages",
                  "pack",
                  "pulse",
                  "skillset",
                  "spiral",
                  "stream"
                ],
                "description": "A visual registered in static/js/viz/<kind>.js"
              },
              "source": {
                "enum": [
                  "github.contributions",
                  "github.languages",
                  "index.languages",
                  "index.years",
                  "index.repos",
                  "recent.commits",
                  "work.commits",
                  "work.all",
                  "glossary.terms",
                  "index.skillset",
                  "catalogue.graph",
                  "tags.all",
                  "tags.together",
                  "experience.engagements"
                ]
              },
              "title": {
                "type": "string",
                "pattern": "^[a-z0-9_]+$",
                "description": "i18n key"
              },
              "lead": {
                "type": "string",
                "pattern": "^[a-z0-9_]+$",
                "description": "i18n key"
              },
              "span": {
                "type": "integer",
                "minimum": 1
              },
              "height": {
                "enum": [
                  "sm",
                  "md",
                  "lg"
                ]
              },
              "tone": {
                "enum": [
                  "night"
                ],
                "description": "A dark sky behind the visual in both themes"
              }
            }
          }
        },
        "terms": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$",
            "description": "A term id of data/glossary.toml"
          },
          "description": "The glossary terms this page builds on; rendered as 'Concepts on this page' and linked back from each term's page (scripts/check-glossary.mjs)."
        },
        "article_title": {
          "type": "string",
          "minLength": 3,
          "maxLength": 80,
          "description": "Heading of the page's article (its Markdown body); defaults to the title."
        },
        "term": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$",
          "description": "A term id of data/glossary.toml"
        },
        "kind": {
          "enum": [
            "language",
            "technology",
            "concept"
          ]
        },
        "definition": {
          "type": "string",
          "minLength": 20
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reference": {
          "type": "object",
          "required": [
            "title",
            "url"
          ],
          "additionalProperties": false,
          "properties": {
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "pattern": "^https://"
            }
          }
        },
        "pages": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9/_.-]+\\.md$"
          }
        },
        "related": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$",
            "description": "A term id of data/glossary.toml"
          }
        }
      }
    },
    "sort_by": {
      "enum": [
        "weight",
        "date",
        "title"
      ]
    },
    "taxonomies": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tags": {
          "type": "array",
          "minItems": 1,
          "maxItems": 12,
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "description": "Zola taxonomies; tags are derived by the generators (category, languages)."
    },
    "page_template": {
      "type": "string",
      "pattern": "^[a-z-]+\\.html$"
    }
  }
}
