gatsby-theme-curiousity
Version:
The Gatsby theme that builds the portfolio component of my website
16 lines (14 loc) • 518 B
text/typescript
import { RemarkCreatorPlugin } from "gatsby-tinacms-remark";
import slugify from "slugify";
export const CreatePiecePlugin = new RemarkCreatorPlugin({
label: "New Portfolio Piece",
filename: (form): string => {
return `content/portfolio/${slugify(form.title, { lower: true })}.md`;
},
fields: [{ name: "title", label: "Title", component: "text" }],
frontmatter: (form): object => ({
title: form.title,
}),
body: (): string =>
`This is a new portfolio piece. Please write some content.`,
});