How to use the gatsby-tinacms-json.JsonCreatorPlugin function in gatsby-tinacms-json

To help you get started, we’ve selected a few gatsby-tinacms-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinacms / tina-starter-grande / src / components / siteLayout.js View on Github external
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,
        })

gatsby-tinacms-json

A Gatsby/Tina plugin for **editing JSON files stored in git**.

Apache-2.0
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis