Scaffold out a new Gatsby post
- Generates folder structure and
frontmatter
Async/await
ready- Simple API
- 100% test coverage
- Doesnʼt bundle a CLI. See new-gatsby-post-cli for the command-line tool
npm install --save new-gatsby-post
$ pwd
/Users/luftywiranda/blog
const newGatsbyPost = require('new-gatsby-post');
newGatsbyPost('At Least I Tried', { date: '2013-08-05' }).then(path => {
console.log(path);
//=> '/Users/luftywiranda/blog/src/pages/blog/2013-08-05-at-least-i-tried'
});
$ tree
.
└── src
└── pages
└── blog
└── 2013-08-05-at-least-i-tried
└── index.md
Returns a promise
for the path to the created blog post's directory
Type: string
Type: Object
Type: string
Default: ./src/pages/blog
Type: string
| number
| Date
Default: Date.now()
Date in yyyy-mm-dd
format
- new-gatsby-post-cli – CLI for this module
MIT © Lufty Wiranda