1.0.9 • Published 2 years ago

docusaurus-post-generator v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

docusaurus-post-generator

A cli tool like hexo's hexo new [post name]

demo

How to Use ?

1. Install

Install with npm

npm i --save-dev docusaurus-post-generator

Install with yarn

yarn add -D docusaurus-post-generator

2. add script into your docusaurus project

...
  "scripts": {
    ...
    "postgen":"docusaurus-post-generator"  
  }
...

3. run script with new command

yarn postgen new [template] [post_name] --type [type] 

args:

  • post_name: the post file name you want to add with.
  • template: the corresponding template file in template folder.
  • type (optional): the type of the post content, either doc or blog, default set to blog.

a example of script might like this:

yarn postgen new frontend_template 'A technology of Javascript' 

4. Add a post to a subfolder of docs/blog

You can also add a post file into subfolder by adding a prefix like:

yarn postgen new frontend_template 'javascript/A technology of Javascript'

and a file will be created at blog/javascript/2022-08-13-A-technology-of-Javascript.md in your project.

Template Example

---
slug: your-post-name
title: Your Post Name
authors: mujing
tags: [someTag]
hide_table_of_contents: false
---

Your can learn more about markdown file metadata here.

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago