feat: interactive cli to generate post

This commit is contained in:
Timothy Lin
2021-07-04 16:12:36 +08:00
parent c31a4f0aa1
commit 6d750076c9
5 changed files with 343 additions and 48 deletions

View File

@ -137,17 +137,9 @@ images: ['/static/images/canada/mountains.jpg', '/static/images/canada/toronto.j
### Compose
`scripts/compose.js` can be used to easily generate a post with pre-filled front matter.
Run `node ./scripts/compose.js` to bootstrap a new post.
The first argument is the name of the post and the second optional argument is the extension (default to .mdx)
Example code to generate the post called "My First Post" in markdown format
```
node ./scripts/compose.js "My First Post" .md
```
This will generate `./data/blog/my-first-post.md` with pre-filled front matter.
Follow the interactive prompt to generate a post with pre-filled front matter.
## Deploy