From 69856326c6b7aa590995cd268ceeed3cbf385be6 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Wed, 16 Dec 2020 15:28:42 +0000 Subject: [PATCH] feat(cms): add support to edit widget backgrounds Supports: - Solid color - Gradient color - Image background - Darken image - Text color light/dark --- netlify-cms-academic/static/admin/config.yml | 39 +++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/netlify-cms-academic/static/admin/config.yml b/netlify-cms-academic/static/admin/config.yml index 6ff13bef..da8f1add 100644 --- a/netlify-cms-academic/static/admin/config.yml +++ b/netlify-cms-academic/static/admin/config.yml @@ -1,13 +1,16 @@ backend: name: git-gateway branch: master -media_folder: 'static/media/' -public_folder: 'media' +media_folder: 'static/media' +public_folder: '/media' collections: - name: home label: "Homepage" folder: 'content/home' path: '{{slug}}' + # When specifying a path on a folder collection, media_folder defaults to an empty string, so make it explicit. + media_folder: '/static/media' + public_folder: '' summary: "{{filename}}: {{title}}" identifier_field: "widget_id" create: true @@ -36,6 +39,38 @@ collections: required: false fields: - {label: "Columns (options: `1` or `2`)", name: "columns", widget: "string", default: "2", required: false} + - label: "Background" + name: "background" + widget: "object" + required: false + fields: + - {label: 'Solid color', name: 'color', widget: 'color', enableAlpha: true, allowInput: true, required: false} + - {label: 'Gradient start', name: 'gradient_start', widget: 'color', enableAlpha: true, allowInput: true, required: false} + - {label: 'Gradient end', name: 'gradient_end', widget: 'color', enableAlpha: true, allowInput: true, required: false} + - label: "Use a light text color?" + name: "text_color_light" + required: false + widget: "boolean" + default: false + - label: "Image" + name: "image" + widget: "image" + required: false + # When specifying a path on a folder collection, media_folder defaults to an empty string, so make it explicit. + media_folder: '/static/media' + public_folder: '' + media_library: + config: + multiple: false + - label: "Darken the image? (0 is transparent & 1 is opaque)" + name: "image_darken" + widget: "number" + default: 0.0 + valueType: "float" + min: 0.0 + max: 1.0 + step: 0.1 + required: false - {label: "Body", name: "body", widget: "markdown", required: false} - name: authors label: Authors