How to use the gatsby-tinacms-remark.createRemarkButton function in gatsby-tinacms-remark

To help you get started, we’ve selected a few gatsby-tinacms-remark 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 / tinacms / packages / demo-gatsby / src / components / layout.js View on Github external
marginLeft: `auto`,
            marginRight: `auto`,
            maxWidth: rhythm(24),
            padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
          }}
        >
          © {new Date().getFullYear()}, Built with
          {` `}
          <a href="https://www.gatsbyjs.org">Gatsby</a>
        
      
    )
  }
}

const CreatePostPlugin = createRemarkButton({
  label: "Create Post",
  filename({ title }) {
    return `content/blog/${title.replace(/\s+/g, "-").toLowerCase()}/index.md`
  },
  frontmatter({ title }) {
    // Asynchronously generate front matter by fetching data from some server.
    return new Promise(resolve =&gt; {
      setTimeout(() =&gt; {
        resolve({
          title,
          date: new Date(),
          heading_color: "pink",
          description: "My new post. ",
        })
      }, 1000)
    })
github tinacms / tina-starter-grande / src / components / siteLayout.js View on Github external
&lt;&gt;
      
        
      
      
        
          <header>
          {children}
          <footer>
        
      
    
  )
}

const CreatePostButton = createRemarkButton({
  label: "New Post",
  filename(form) {
    let slug = slugify(form.title.toLowerCase())
    return `content/posts/${slug}.md`
  },
  frontmatter(form) {
    let slug = slugify(form.title.toLowerCase())
    return new Promise(resolve =&gt; {
      setTimeout(() =&gt; {
        resolve({
          title: form.title,
          date: new Date(),
          type: "post",
          path: `/blog/${slug}`,
          draft: true,
        })</footer></header>

gatsby-tinacms-remark

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

Apache-2.0
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis