1.0.3 • Published 8 years ago
new-gatsby-post v1.0.3
new-gatsby-post
Scaffold out a new Gatsby post
Why
- Generates folder structure and
frontmatter Async/awaitready- Simple API
- 100% test coverage
- Doesnʼt bundle a CLI
Installation
npm install --save new-gatsby-postUsage
$ pwd
/Users/luftywiranda/blogconst 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.mdAPI
newGatsbyPost(title, options)
Returns a promise for the path to the created blog post's directory
title
Type: string
options
Type: Object
location
Type: string
Default: ./src/pages/blog
date
Type: string | number | Date
Default: Date.now()
Date in yyyy-mm-dd format
Related
- new-gatsby-post-cli – CLI for this module
License
MIT © Lufty Wiranda