From 157a1529f421beaa0a9508006acef2f31200f45f Mon Sep 17 00:00:00 2001 From: Lee Cattarin Date: Thu, 24 Sep 2026 09:58:16 -0700 Subject: [PATCH] Posts collection --- .mattrbld/collections/posts.json | 21 ++++ .mattrbld/config.json | 12 +- .mattrbld/schemas/post.json | 198 +++++++++++++++++++++++++++++++ src/posts/.gitkeep | 0 4 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 .mattrbld/collections/posts.json create mode 100644 .mattrbld/schemas/post.json create mode 100644 src/posts/.gitkeep diff --git a/.mattrbld/collections/posts.json b/.mattrbld/collections/posts.json new file mode 100644 index 0000000..9a3d2e1 --- /dev/null +++ b/.mattrbld/collections/posts.json @@ -0,0 +1,21 @@ +{ + "allowedTypes": [], + "defaultFilename": null, + "dir": "/src/posts", + "disableComments": false, + "disablePreview": false, + "draftByDefault": false, + "linkable": true, + "maxSize": null, + "permissions": { + "everybody": [ + "everything" + ] + }, + "rawEntityNames": false, + "schemas": [ + "/.mattrbld/schemas/post.json" + ], + "type": "md", + "urlTemplate": "/posts/:title/" +} \ No newline at end of file diff --git a/.mattrbld/config.json b/.mattrbld/config.json index 4ca86c4..a7f5536 100644 --- a/.mattrbld/config.json +++ b/.mattrbld/config.json @@ -25,7 +25,7 @@ "label": "Help" }, { - "icon": null, + "icon": "document", "label": "Pages", "target": { "name": "Project.Collection", @@ -34,6 +34,16 @@ } } }, + { + "icon": "document-stack", + "label": "Posts", + "target": { + "name": "Project.Collection", + "params": { + "path": "/.mattrbld/collections/posts.json" + } + } + }, { "label": "Media library", "icon": "image-stack", diff --git a/.mattrbld/schemas/post.json b/.mattrbld/schemas/post.json new file mode 100644 index 0000000..dadb456 --- /dev/null +++ b/.mattrbld/schemas/post.json @@ -0,0 +1,198 @@ +{ + "fields": [ + { + "type": "text", + "default": null, + "icon": "text-input", + "key": "title", + "label": "Title", + "localised": false, + "options": { + "wrapping": true, + "multiline": false + }, + "tab": "Content", + "validation": { + "enforceMinMax": true, + "max": null, + "min": null, + "regex": null, + "regexError": null, + "required": true, + "unit": "length" + }, + "value": null, + "version": 1, + "visibility": { + "hidden": false, + "showByValue": { + "field": null + } + } + }, + { + "type": "text", + "default": null, + "icon": "text-input", + "key": "author", + "label": "Author", + "localised": false, + "options": { + "wrapping": true, + "multiline": false + }, + "tab": "Content", + "validation": { + "enforceMinMax": true, + "max": null, + "min": null, + "regex": null, + "regexError": null, + "required": false, + "unit": "length" + }, + "value": null, + "version": 1, + "visibility": { + "hidden": false, + "showByValue": { + "field": null + } + } + }, + { + "type": "date", + "default": null, + "icon": "calendar", + "key": "date", + "label": "Date and Time", + "options": { + "outputFormat": "iso", + "removable": false, + "showTime": true, + "defaultToNow": true, + "useAsUpdatedAt": false, + "only": null + }, + "tab": "Content", + "validation": { + "max": null, + "min": null, + "required": false, + "unit": "date", + "isString": true + }, + "value": null, + "version": 2, + "visibility": { + "hidden": false, + "showByValue": { + "field": null + } + } + }, + { + "type": "image", + "default": null, + "icon": "image", + "key": "image", + "label": "Hero image", + "options": { + "resolutionHint": "", + "removable": true, + "simple": false + }, + "tab": "Content", + "validation": { + "max": null, + "required": false, + "unit": "filesize (MB)" + }, + "value": null, + "version": 1, + "visibility": { + "hidden": false, + "showByValue": { + "field": null + } + } + }, + { + "type": "rich text", + "default": null, + "icon": "text", + "key": "content", + "label": "Body", + "localised": false, + "options": { + "outputFormat": "markdown", + "blockFormats": [ + "blockquote", + "heading", + "hr", + "orderedList", + "unorderedList", + "image", + "codeBlock" + ], + "inlineFormats": [ + "em", + "strong", + "link", + "code" + ], + "formatOptions": [ + "allowQuoteFooters", + "allowNestedLists", + "allowImageCaptions" + ], + "inputRuleOptions": [ + "autoquotes", + "dashes", + "ellipsis", + "noDoubleCaps", + "noDoubleSpace" + ], + "minHeading": 2, + "maxHeading": 4, + "codeLangs": [ + "html", + "css", + "javascript", + "markdown" + ], + "allowRaw": false, + "urlTemplate": "", + "urlSuffix": "", + "linkOptions": [ + "allowExternal", + "allowInternal" + ] + }, + "tab": "Content", + "validation": { + "enforceMinMax": true, + "max": null, + "min": null, + "regex": null, + "regexError": null, + "required": true, + "unit": "length" + }, + "value": null, + "version": 1, + "visibility": { + "hidden": false, + "showByValue": { + "field": null + } + } + } + ], + "tabs": [ + { + "label": "Content", + "groupAs": null + } + ] +} \ No newline at end of file diff --git a/src/posts/.gitkeep b/src/posts/.gitkeep new file mode 100644 index 0000000..e69de29