Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: "post",
path: `/blog/${slug}`,
draft: true,
})
}, 1000)
})
},
body({ title }) {
return `## ${title}`
},
fields: [
{ name: "title", label: "Title", component: "text", required: true },
],
})
const CreatePageButton = new JsonCreatorPlugin({
label: "New Page",
filename(form) {
let slug = slugify(form.title.toLowerCase())
return `content/pages/${slug}.json`
},
fields: [
{ name: "title", label: "Title", component: "text", required: true },
{ name: "path", label: "Path", component: "text", required: true },
],
data(form) {
return new Promise(resolve => {
setTimeout(() => {
resolve({
title: form.title,
path: form.path,
})