Skip to content

Instantly share code, notes, and snippets.

@mgan59
Created November 16, 2014 16:24
Show Gist options
  • Save mgan59/c645973fe592dd8d4725 to your computer and use it in GitHub Desktop.
Save mgan59/c645973fe592dd8d4725 to your computer and use it in GitHub Desktop.
KeystoneJS Server-Side Data Dump for Post
Keystone.list = {
"key":"Post",
"path":"posts",
"label":"Posts",
"singular":"Post",
"plural":"Posts",
"elements":[
{
"type":"field",
"field":{
"path":"state",
"paths":{
"data":"stateData",
"label":"stateLabel",
"options":"stateOptions",
"map":"stateOptionsMap"
},
"type":"select",
"label":"State",
"width":"full",
"ops":[
{
"value":"draft",
"label":"Draft"
},
{
"value":"published",
"label":"Published"
},
{
"value":"archived",
"label":"Archived"
}
]
}
},
{
"type":"field",
"field":{
"path":"author",
"paths":{
"refList":"authorRefList"
},
"type":"relationship",
"label":"Author",
"width":"full"
}
},
{
"type":"field",
"field":{
"path":"publishedDate",
"type":"date",
"label":"Published Date",
"width":"full",
"dependsOn":{
"state":"published"
},
"formatString":"Do MMM YYYY"
}
},
{
"type":"field",
"field":{
"path":"image",
"paths":{
"public_id":"image.public_id",
"version":"image.version",
"signature":"image.signature",
"format":"image.format",
"resource_type":"image.resource_type",
"url":"image.url",
"width":"image.width",
"height":"image.height",
"secure_url":"image.secure_url",
"exists":"image.exists",
"folder":"image.folder",
"upload":"image_upload",
"action":"image_action",
"select":"image_select"
},
"type":"cloudinaryimage",
"label":"Image",
"width":"full",
"nofilter":true
}
},
{
"type":"field",
"field":{
"path":"content.brief",
"paths":{
"md":"content.brief.md",
"html":"content.brief.html"
},
"type":"markdown",
"label":"Content Brief",
"width":"full",
"nofilter":true
}
},
{
"type":"field",
"field":{
"path":"content.extended",
"paths":{
"md":"content.extended.md",
"html":"content.extended.html"
},
"type":"markdown",
"label":"Content Extended",
"width":"full",
"nofilter":true
}
},
{
"type":"field",
"field":{
"path":"categories",
"paths":{
"refList":"categoriesRefList"
},
"type":"relationship",
"label":"Categories",
"width":"full"
}
}
]
};
Keystone.item = {
"id":"54223e557a1c23cb5586884f",
"name":"Post Example Title",
"fields":{
"title":"Post Example Title",
"state":"published",
"author":"53d5b088674f54182ce239f6",
"publishedDate":"2013-01-10T05:00:00.000Z",
"image":{
},
"content.brief":{
"html":"<p>Hello World.</p>\n",
"md":"Hello World"
},
"content.extended":{
"html":"<p>Hello World.</p>\n",
"md":"Hello World"
},
"categories":[
"543dd74295751be4080300fc"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment