From 8f86a7299d75b2905e4e6eb61f43750c51ed48e4 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Tue, 10 Dec 2024 20:34:11 +0100 Subject: feat(config): json schema for custom pages --- config.schema.json | 193 ++++++++++++++++++++++++++++++++++++++++++++++++ custom_page.schema.json | 117 +++++++++++++++++++++++++++++ schema.json | 193 ------------------------------------------------ 3 files changed, 310 insertions(+), 193 deletions(-) create mode 100644 config.schema.json create mode 100644 custom_page.schema.json delete mode 100644 schema.json diff --git a/config.schema.json b/config.schema.json new file mode 100644 index 0000000..9b325c3 --- /dev/null +++ b/config.schema.json @@ -0,0 +1,193 @@ +{ + "type": "object", + "properties": { + "colors": { + "type": "object", + "properties": { + "background": { + "type": "object", + "properties": { + "angle": { + "type": "integer", + "format": "int32", + "minimum": 0, + "maximum": 359 + }, + "colors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32", + "minimum": 0, + "maximum": 100 + } + }, + "additionalProperties": false, + "required": [ + "color", + "position" + ] + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "angle", + "colors" + ] + }, + "buttons": { + "type": "object", + "properties": { + "background": { + "type": "string" + }, + "background_hover": { + "type": "string" + }, + "text": { + "type": "string" + }, + "text_hover": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "text", + "text_hover", + "background", + "background_hover" + ] + }, + "text": { + "type": "string" + }, + "tag_hover": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "background", + "buttons", + "text", + "tag_hover" + ] + }, + "description": { + "type": "string" + }, + "image": { + "type": "string" + }, + "legal": { + "type": "object", + "properties": { + "font_source": { + "type": "string" + }, + "images_source": { + "type": "array", + "items": { + "type": "string" + } + }, + "legal_information_link": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "legal_information_link", + "images_source", + "font_source" + ] + }, + "links": { + "type": "array", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "link": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "link", + "content" + ] + } + }, + "person": { + "type": "object", + "properties": { + "image": { + "type": "string" + }, + "name": { + "type": "string" + }, + "pronouns": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "link": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "link" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "pronouns", + "image", + "tags" + ] + }, + "custom_pages": { + "type": "array" + } + }, + "additionalProperties": false, + "required": [ + "image", + "description", + "person", + "colors", + "links", + "legal" + ] +} diff --git a/custom_page.schema.json b/custom_page.schema.json new file mode 100644 index 0000000..c7a1907 --- /dev/null +++ b/custom_page.schema.json @@ -0,0 +1,117 @@ +{ + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "image": { + "type": "string" + }, + "description": { + "type": "string" + }, + "colors": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "tag_hover": { + "type": "string" + }, + "background": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "angle": { + "type": "number" + }, + "colors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "position": { + "type": "number" + } + }, + "required": [ + "color", + "position" + ] + } + } + }, + "required": [ + "type", + "angle", + "colors" + ] + }, + "buttons": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "text_hover": { + "type": "string" + }, + "background": { + "type": "string" + }, + "background_hover": { + "type": "string" + } + }, + "required": [ + "text", + "text_hover", + "background", + "background_hover" + ] + } + }, + "required": [ + "text", + "tag_hover", + "background", + "buttons" + ] + }, + "content": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "content": { + "type": "string" + } + }, + "required": [ + "type", + "content" + ] + } + } + }, + "required": [ + "title", + "uri", + "image", + "description", + "colors", + "content" + ] +} \ No newline at end of file diff --git a/schema.json b/schema.json deleted file mode 100644 index 9b325c3..0000000 --- a/schema.json +++ /dev/null @@ -1,193 +0,0 @@ -{ - "type": "object", - "properties": { - "colors": { - "type": "object", - "properties": { - "background": { - "type": "object", - "properties": { - "angle": { - "type": "integer", - "format": "int32", - "minimum": 0, - "maximum": 359 - }, - "colors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "color": { - "type": "string" - }, - "position": { - "type": "integer", - "format": "int32", - "minimum": 0, - "maximum": 100 - } - }, - "additionalProperties": false, - "required": [ - "color", - "position" - ] - } - }, - "type": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "type", - "angle", - "colors" - ] - }, - "buttons": { - "type": "object", - "properties": { - "background": { - "type": "string" - }, - "background_hover": { - "type": "string" - }, - "text": { - "type": "string" - }, - "text_hover": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "text", - "text_hover", - "background", - "background_hover" - ] - }, - "text": { - "type": "string" - }, - "tag_hover": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "background", - "buttons", - "text", - "tag_hover" - ] - }, - "description": { - "type": "string" - }, - "image": { - "type": "string" - }, - "legal": { - "type": "object", - "properties": { - "font_source": { - "type": "string" - }, - "images_source": { - "type": "array", - "items": { - "type": "string" - } - }, - "legal_information_link": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "legal_information_link", - "images_source", - "font_source" - ] - }, - "links": { - "type": "array", - "items": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "link": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "link", - "content" - ] - } - }, - "person": { - "type": "object", - "properties": { - "image": { - "type": "string" - }, - "name": { - "type": "string" - }, - "pronouns": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "link": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "name", - "description", - "link" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "name", - "pronouns", - "image", - "tags" - ] - }, - "custom_pages": { - "type": "array" - } - }, - "additionalProperties": false, - "required": [ - "image", - "description", - "person", - "colors", - "links", - "legal" - ] -} -- cgit v1.2.3