diff options
| author | Mathias Biilmann Christensen <info@mathias-biilmann.net> | 2017-03-19 13:16:33 -0700 |
|---|---|---|
| committer | Mathias Biilmann Christensen <info@mathias-biilmann.net> | 2017-03-19 13:16:33 -0700 |
| commit | 625a4bef4c57981a561d1f0f66d7435703170ff8 (patch) | |
| tree | 942315fb99c3050c57d7e312b275e1e0584d838e /src | |
| parent | 4c0b25582faa403191286275fa678cd89622c63b (diff) | |
Fix image uploads
Diffstat (limited to 'src')
| -rw-r--r-- | src/cms/config.yml | 5 | ||||
| -rw-r--r-- | src/js/cms-preview-templates/post.js | 3 | ||||
| -rw-r--r-- | src/js/cms.js | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cms/config.yml b/src/cms/config.yml index 9be0a70..89af1d6 100644 --- a/src/cms/config.yml +++ b/src/cms/config.yml @@ -3,8 +3,8 @@ backend: repo: <% GITHUB_REPOSITORY %> # Gulp will replace this with your GitHub repository branch: master # Branch to update (master by default) -media_folder: "dist/img" # Folder where user uploaded files should go -public_folder: "dist" # CMS now knows 'source' is the public folder and will strip this from the path +media_folder: "site/static/img" # Folder where user uploaded files should go +public_folder: "img" collections: # A list of collections the CMS should be able to edit - name: "post" # Used in routes, ie.: /admin/collections/:slug/edit @@ -13,7 +13,6 @@ collections: # A list of collections the CMS should be able to edit create: true # Allow users to create new documents in this collection fields: # The fields each document in this collection have - {label: "Title", name: "title", widget: "string"} - - {label: "A color", name: "color", widget: "color"} - {label: "Publish Date", name: "date", widget: "datetime"} - {label: "Intro Blurb", name: "description", widget: "text"} - {label: "Image", name: "image", widget: "image", required: false} diff --git a/src/js/cms-preview-templates/post.js b/src/js/cms-preview-templates/post.js index 38ab505..eca7374 100644 --- a/src/js/cms-preview-templates/post.js +++ b/src/js/cms-preview-templates/post.js @@ -10,8 +10,7 @@ export default class PostPreview extends React.Component { <div className="flex justify-between grey-3"> <div style={{ width: "80px", - height: "80px", - backgroundColor: entry.getIn(['data', 'color']) + height: "80px" }}></div> <p>{ format(entry.getIn(["data", "date"]), "ddd, MMM D, YYYY") }</p> <p>Read in x minutes</p> diff --git a/src/js/cms.js b/src/js/cms.js index aae6669..8502ed0 100644 --- a/src/js/cms.js +++ b/src/js/cms.js @@ -4,6 +4,8 @@ import CMS from "netlify-cms"; import PostPreview from "./cms-preview-templates/post"; import ProductsPreview from "./cms-preview-templates/products"; + +// Example of creating a custom color widget class ColorControl extends React.Component { render() { return <input |
