vuepress-commander v1.0.1-alpha.4
Vuepress-Commander
vuepress-commander makes it easier to create and deploy posts in the vuepress using cli.
Introduction
The cli in vuepress is cumbersome.
To compensate for this, we created a vuepress-commander.
vuepress-commander now solves the task of creating new posts each time. You can also easily distribute build results to github.
Features :
- Create a new post using the
newcommand. - You have integrated with the basic command in vuepress. Run local server with
servecommand and build withgenerate. - Use the
deploycommand to distribute to git.
Infos
install
npm
npm install -g vuepress-commanderyarn
yarn add global vuepress-commanderCommand List
The vuepress-commander runs with the vpc command. Try using the --help command.
vpc --helpvpc v1.0.0
Usage:
$ vpc <command> [options]
Commands:
new <post-name> Create a new post.
serve Runs the local server.
generate Builds as a static page.
clean [clean-dir] Delete the build result.
deploy Deploy the build results to the git.
For more info, run any command with the `--help` flag:
$ vpc new --help
$ vpc serve --help
$ vpc generate --help
$ vpc clean --help
$ vpc deploy --help
Options:
-h, --help Display this message
-v, --version Display version numbervpc new
The new command generates a new post. <post-name> parameter must be specified.
vpc new <post-name>--folder, -f [folder]
Please specify the folder where the new post will be created. The default route is docs.
- Default:
docs
vpc new <post-name> --folder src // creating in docs/srcvpc serve
Run the Local Server. vpc serve is the same as vuepress dev.
vpc servevpc generate
Build as a static page. vpc generate is the same as vuepress build.
vpc generatevpc clean
Delete Build Results. The default path is .vuepress/dist.
vpc clean[clean-dir]
- Default:
.vuepress/dist
vpc clean docs/dist // Delete 'docs/dist'vpc deploy
Distribute built deliverables to github.
⚠️To deploy to github, the basic settings for git must be applied.
⚠️In the pre-release version, the remote name is origin and the branch name is master.
e.g
git init
git remote add origin master <repository-url>vpc deployconfiguration
The vuepress-commander can specify options for the command through the settings file.
Create the vpc.config.js file in the top-level path. Define all options in vpc.config.js.
Try it now.
vpc.config.js
module.exports = {
basePath: 'docs',
git: 'https://github.com/<user-name>/<repository>.git',
dest: '.vuepress/dist'
}basePath
basePath is the default path for all options that require routing.
- Type:
String - Default:
docs
git
The git repository address required for the deploy command.
⚠️In the pre-release version, the remote name is origin and the branch name is master.
- Type:
String - Default:
void 0
dest
The path where the results will be stored at build.
- Type:
String - Default:
.vuepress/dist
Help-Me
Do you have any other ideas? Please help me.
License
MIT License Copyright (c) Dev.DY