aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cms/config.yml4
-rw-r--r--src/js/cms-preview-templates/post.js4
-rw-r--r--src/js/cms.js16
3 files changed, 22 insertions, 2 deletions
diff --git a/src/cms/config.yml b/src/cms/config.yml
index 3b209aa..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
diff --git a/src/js/cms-preview-templates/post.js b/src/js/cms-preview-templates/post.js
index 0c819fd..eca7374 100644
--- a/src/js/cms-preview-templates/post.js
+++ b/src/js/cms-preview-templates/post.js
@@ -8,6 +8,10 @@ export default class PostPreview extends React.Component {
return <div className="mw6 center ph3 pv4">
<h1 className="f2 lh-title b mb3">{ entry.getIn(["data", "title"])}</h1>
<div className="flex justify-between grey-3">
+ <div style={{
+ width: "80px",
+ height: "80px"
+ }}></div>
<p>{ format(entry.getIn(["data", "date"]), "ddd, MMM D, YYYY") }</p>
<p>Read in x minutes</p>
</div>
diff --git a/src/js/cms.js b/src/js/cms.js
index 289b26a..8502ed0 100644
--- a/src/js/cms.js
+++ b/src/js/cms.js
@@ -1,7 +1,23 @@
+import React from "react";
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
+ style={{height: "80px"}}
+ type="color"
+ value={this.props.value}
+ onInput={(e) => this.props.onChange(e.target.value)}
+ />;
+ }
+}
+
CMS.registerPreviewStyle("/css/main.css");
CMS.registerPreviewTemplate("post", PostPreview);
CMS.registerPreviewTemplate("products", ProductsPreview);
+CMS.registerWidget("color", ColorControl);