Simple command line interface to scaffold out a blog post folder structure
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore refactor: change default date format to year first, fix tests Jul 18, 2017
.travis.yml chore: update notification settings Jul 18, 2017 chore: add travis badge Jul 18, 2017
package.json chore: bump version Jul 18, 2017
yarn.lock chore: update tests Jul 17, 2017


Build Status

A utility and CLI to scaffold out a blog post that follows the gatsby pages/ format, including a MD file with some default frontmatter (data) set up.

Set up

yarn add @dschau/create-gatsby-blog-post --dev

or for global usage

yarn global add @dschau/create-gatsby-blog-post


createPost(post: string, [options])

const { createPost } = require('create-gatsby-blog-post');

createPost('hello-world'); // will create the folder `src/pages/YYYY-MM-DD-hello-world` with `` inside


Name Description Default
date Pass in a custom date object to use as the "now" value +new Date()
dateFormat Format the date according to a date-fns format string YYYY-MM-DD
root Root directory to use to place the blog post/markdown file src/pages
tags Whether to place frontmatter "tags" key in each post true


create-post -- --date-format "YYYY-MMM-DD" hello-world