Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return "packages/demo-gatsby" + postDirectory
},
// Generate the src attribute for the preview image.
previewSrc: (formValues, { input }) => {
let path = input.name.replace("rawFrontmatter", "frontmatter")
let gastbyImageNode = get(formValues, path)
if (!gastbyImageNode) return ""
return gastbyImageNode.childImageSharp.fluid.src
},
},
],
}
export default liveRemarkForm(BlogPostTemplate, BlogPostForm)
export const pageQuery = graphql`
query BlogPostBySlug($slug: String!) {
site {
siteMetadata {
title
author
}
}
markdownRemark(fields: { slug: { eq: $slug } }) {
...TinaRemark
id
excerpt(pruneLength: 160)
html
frontmatter {
blocks {