Strengthen reusable Astro site foundation

This commit is contained in:
Kevin
2026-09-02 01:47:27 -04:00
parent 7557fa47b9
commit 19bba4282e
13 changed files with 101 additions and 16 deletions
+40
View File
@@ -0,0 +1,40 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sloanops.com/schemas/site.schema.json",
"type": "object",
"additionalProperties": false,
"required": ["name", "description", "theme", "branding", "seo", "nav", "hero"],
"properties": {
"name": { "type": "string", "minLength": 1, "maxLength": 120 },
"description": { "type": "string", "minLength": 1, "maxLength": 200 },
"analyticsId": { "type": "string", "pattern": "^G-[A-Z0-9]+$" },
"theme": { "$ref": "#/$defs/theme" },
"branding": { "$ref": "#/$defs/branding" },
"seo": { "$ref": "#/$defs/seo" },
"nav": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "$ref": "#/$defs/navItem" } },
"contact": { "$ref": "#/$defs/contact" },
"hero": { "$ref": "#/$defs/hero" },
"features": { "type": "array", "maxItems": 12, "items": { "$ref": "#/$defs/card" } },
"services": { "type": "array", "maxItems": 24, "items": { "$ref": "#/$defs/service" } },
"reviews": { "type": "array", "maxItems": 12, "items": { "$ref": "#/$defs/review" } },
"story": { "$ref": "#/$defs/story" },
"team": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/team" } },
"posts": { "type": "array", "maxItems": 24, "items": { "$ref": "#/$defs/post" } }
},
"$defs": {
"text": { "type": "string", "minLength": 1, "maxLength": 1000 },
"imagePath": { "type": "string", "pattern": "^/images/[a-z0-9][a-z0-9-]*\\.(jpg|jpeg|png|webp|svg)$" },
"theme": { "type": "object", "additionalProperties": false, "required": ["accent", "ink", "surface"], "properties": { "accent": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }, "ink": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }, "surface": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" } } },
"branding": { "type": "object", "additionalProperties": false, "required": ["wordmark", "mark", "logo"], "properties": { "wordmark": { "type": "string", "minLength": 1, "maxLength": 48 }, "mark": { "type": "string", "minLength": 1, "maxLength": 3 }, "logo": { "anyOf": [{ "$ref": "#/$defs/imagePath" }, { "type": "null" }] } } },
"seo": { "type": "object", "additionalProperties": false, "required": ["socialImage"], "properties": { "socialImage": { "$ref": "#/$defs/imagePath" }, "locality": { "type": "string", "maxLength": 120 } } },
"navItem": { "type": "object", "additionalProperties": false, "required": ["label", "href"], "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 32 }, "href": { "type": "string", "pattern": "^(?:/|https://)" } } },
"contact": { "type": "object", "additionalProperties": false, "required": ["email", "phone", "phoneHref", "address", "hours", "showMap"], "properties": { "email": { "type": "string", "format": "email" }, "phone": { "type": "string", "minLength": 7, "maxLength": 30 }, "phoneHref": { "type": "string", "pattern": "^\\+[0-9]{7,20}$" }, "address": { "type": "string", "minLength": 1, "maxLength": 240 }, "hours": { "type": "string", "maxLength": 120 }, "showMap": { "type": "boolean" } } },
"hero": { "type": "object", "additionalProperties": false, "required": ["eyebrow", "headline", "copy", "image", "imageAlt", "cta", "ctaHref"], "properties": { "eyebrow": { "$ref": "#/$defs/text" }, "headline": { "type": "string", "minLength": 1, "maxLength": 160 }, "copy": { "$ref": "#/$defs/text" }, "image": { "$ref": "#/$defs/imagePath" }, "imageAlt": { "$ref": "#/$defs/text" }, "cta": { "type": "string", "minLength": 1, "maxLength": 64 }, "ctaHref": { "type": "string", "pattern": "^(?:/|https://)" } } },
"card": { "type": "object", "additionalProperties": false, "required": ["title", "description"], "properties": { "icon": { "type": "string", "maxLength": 8 }, "title": { "$ref": "#/$defs/text" }, "description": { "$ref": "#/$defs/text" } } },
"service": { "type": "object", "additionalProperties": false, "required": ["title", "description", "price", "items"], "properties": { "title": { "$ref": "#/$defs/text" }, "description": { "$ref": "#/$defs/text" }, "price": { "type": "string", "maxLength": 48 }, "items": { "type": "array", "minItems": 1, "maxItems": 12, "items": { "$ref": "#/$defs/text" } } } },
"review": { "type": "object", "additionalProperties": false, "required": ["quote", "author", "rating"], "properties": { "quote": { "$ref": "#/$defs/text" }, "author": { "type": "string", "minLength": 1, "maxLength": 120 }, "rating": { "type": "integer", "minimum": 1, "maximum": 5 } } },
"story": { "type": "object", "additionalProperties": false, "required": ["heading", "copy", "image", "imageAlt"], "properties": { "heading": { "$ref": "#/$defs/text" }, "copy": { "$ref": "#/$defs/text" }, "image": { "$ref": "#/$defs/imagePath" }, "imageAlt": { "$ref": "#/$defs/text" } } },
"team": { "type": "object", "additionalProperties": false, "required": ["name", "role", "bio", "image"], "properties": { "name": { "$ref": "#/$defs/text" }, "role": { "$ref": "#/$defs/text" }, "bio": { "$ref": "#/$defs/text" }, "image": { "$ref": "#/$defs/imagePath" } } },
"post": { "type": "object", "additionalProperties": false, "required": ["title", "excerpt", "date", "tag"], "properties": { "title": { "$ref": "#/$defs/text" }, "excerpt": { "$ref": "#/$defs/text" }, "date": { "$ref": "#/$defs/text" }, "tag": { "$ref": "#/$defs/text" } } }
}
}