Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dschau/create-gatsby-blog-post
Simple command line interface to scaffold out a blog post folder structure
https://github.com/dschau/create-gatsby-blog-post
blog-post cli gatsby javascript node post scaffold
Last synced: about 1 month ago
JSON representation
Simple command line interface to scaffold out a blog post folder structure
- Host: GitHub
- URL: https://github.com/dschau/create-gatsby-blog-post
- Owner: DSchau
- Created: 2017-07-10T01:44:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-09T15:41:16.000Z (almost 7 years ago)
- Last Synced: 2024-04-26T12:02:18.989Z (7 months ago)
- Topics: blog-post, cli, gatsby, javascript, node, post, scaffold
- Language: TypeScript
- Size: 49.8 KB
- Stars: 34
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `create-gatsby-blog-post`
[![Build Status](https://travis-ci.org/DSchau/create-gatsby-blog-post.svg?branch=master)](https://travis-ci.org/DSchau/create-gatsby-blog-post)
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`
## Usage
### `createPost(post: string, [options])`
```javascript
const { createPost } = require('create-gatsby-blog-post');createPost('hello-world'); // will create the folder `src/pages/YYYY-MM-DD-hello-world` with `index.md` inside
```#### Options
|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](https://date-fns.org/docs/format)|`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`|### CLI
```bash
create-post -- --date-format "YYYY-MMM-DD" hello-world
```