feat(media): add external media library support, Uploadcare integration (#1602)

This commit is contained in:
Shawn Erquhart
2018-08-30 16:24:28 -04:00
committed by GitHub
parent ae28f6301e
commit 0596904e0b
34 changed files with 715 additions and 135 deletions

View File

@ -2,9 +2,9 @@ backend:
name: test-repo
display_url: https://example.com
media_folder: "assets/uploads"
publish_mode: editorial_workflow
media_folder: assets/uploads
collections: # A list of collections the CMS should be able to edit
- name: "posts" # Used in routes, ie.: /admin/collections/:slug/edit
@ -19,7 +19,12 @@ collections: # A list of collections the CMS should be able to edit
fields: # The fields each document in this collection have
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Publish Date", name: "date", widget: "datetime", format: "YYYY-MM-DD hh:mma"}
- {label: "Cover Image", name: "image", widget: "image", required: false, tagname: ""}
- label: "Cover Image"
name: "image"
widget: "image"
required: false
tagname: ""
- {label: "Body", name: "body", widget: "markdown", hint: "Main content goes here."}
meta:
- {label: "SEO Description", name: "description", widget: "text"}

View File

@ -83,12 +83,10 @@
var PostPreview = createClass({
render: function() {
var entry = this.props.entry;
var image = entry.getIn(['data', 'image']);
var bg = image && this.props.getAsset(image);
return h('div', {},
h('div', {className: "cover"},
h('h1', {}, entry.getIn(['data', 'title'])),
bg ? h('img', {src: bg.toString()}) : null
this.props.widgetFor('image'),
),
h('p', {},
h('small', {}, "Written " + entry.getIn(['data', 'date']))