Skip to content

Rain120/vuepress-docs-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitHub watchers STAR FORK

ISSUES GitHub closed pull requests COMMIT

LANGUAGES VERSION LICENSE

๐Ÿ˜š Welcome

Welcome to the Vuepress Docs Template

๐ŸŽฎ TL;DR

โŒจ๏ธ To be Continue...

โœ Why am I doing this?

Easy to write documents for someone.

๐Ÿ”จ Usage

Pure Document

git clone git@github.com:Rain120/vuepress-docs-template.git

yarn install # or npm install

Deploy

We are auto deploy when you are commit by the pre-commit of the husky hooks. So you just need to add, commit, push. Etc:

git add .
git commit -m 'feat: vuepress docs template commit'

# if you need to pulls
# git pull origin master

git push origin master

We can also deploy by yourself, but we also deploy it when you commit, if you want to deploy by yourself, you can modify the pre-commit of the husky hooks, remove the command with npm run deploy.

npm run deploy

Project Document

Let me see our template folders.

tree . -al 3 -I "node_modules|dist|images|.git|.DS_Store"
.
โ”œโ”€โ”€ .github
โ”‚ย ย  โ””โ”€โ”€ ISSUE_TEMPLATE
โ”‚ย ย      โ”œโ”€โ”€ bug_report.md
โ”‚ย ย      โ”œโ”€โ”€ custom.md
โ”‚ย ย      โ””โ”€โ”€ feature_request.md
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ commitlint.config.js
โ”œโ”€โ”€ deploy.sh # copy to your project root
โ”œโ”€โ”€ docs # copy to your project root
โ”‚ย ย  โ”œโ”€โ”€ .vuepress
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ components
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ MySWUpdatePopup.vue
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ config.js
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ enhanceApp.js
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ public
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ logo.png
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ manifest.json
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ styles
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ index.styl
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ theme
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ utils
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ alias.json
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ copy.js
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ nav.js
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ plugins.js
โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ sidebarHelper.js
โ”‚ย ย  โ”œโ”€โ”€ README.md
โ”‚ย ย  โ””โ”€โ”€ zh
โ”‚ย ย      โ”œโ”€โ”€ guide
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ README.md
โ”‚ย ย      โ”œโ”€โ”€ how-to-config-docs
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ README.md
โ”‚ย ย      โ””โ”€โ”€ how-to-write-docs
โ”‚ย ย          โ””โ”€โ”€ README.md
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ wechat-zhifubao-pay.png
โ””โ”€โ”€ yarn.lock
3 [error opening dir]

13 directories, 27 files

First copy the docs folder and the deploy.sh file to your project root, and then we need to copy something in package.json. Let's do it.

package

Now we had seen all things about package.json. We just need devDependencies, if you had someone of devDependencies, you needn't all of that.

devDependencies

{
  "devDependencies": {
    "@vuepress/plugin-back-to-top": "^1.2.0",
    "@vuepress/plugin-blog": "^1.9.2",
    "@vuepress/plugin-google-analytics": "^1.2.0",
    "@vuepress/plugin-medium-zoom": "^1.0.0-rc.1",
    "@vuepress/plugin-pwa": "^1.3.0",
    "conventional-changelog-cli": "^2.0.27",
    "husky": "^3.0.9",
    "lint-staged": "^9.4.3",
    "markdown-it-imsize": "^2.0.1",
    "markdown-it-katex": "^2.0.3",
    "markdown-it-task-lists": "^2.1.1",
    "moment": "^2.24.0",
    "vuepress": "^1.3.1",
    "vuepress-plugin-awesome-gitalk": "^0.0.4"
  }
}

If you don't want to format your commit and changelog, there 3 package you can remove it. But if you need it and you have not config it, please go to husky

{
  "devDependencies": {
    "conventional-changelog-cli": "^2.0.27",
    "husky": "^3.0.9",
    "lint-staged": "^9.4.3"
  }
}

scripts

{
  "scripts": {
    "lint-staged": "lint-staged",
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
    "docs:dev": "vuepress dev docs",
    "docs:build": "vuepress build docs",
    "deploy": "bash ./scripts/deploy.sh",
    "remote": "bash ./scripts/add-remote.sh"
  }
}

If you don't want to format your commit and changelog, there 2 scripts you can remove it. But if you need it and you have not config it, please go to husky

{
  "scripts": {
    "lint-staged": "lint-staged",
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
  }
}

husky

{
  "lint-staged": {
    "{src}/**/**.ts": [
      "git add"
    ]
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run changelog && npm run deploy && git add . && lint-staged",
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
}

More Config Detail Please Goto the Links.

how-to-config-docs

how-to-write-docs

Now you have all mine, Enjoy yourself!! ๐Ÿ˜‰๐Ÿ˜‰๐Ÿ˜‰

๐Ÿค Contributing

PR

We welcome all contributions. You can submit any ideas as pull requests or as a GitHub issue.

๐Ÿ”— Links

๐Ÿ‘จโ€๐Ÿญ Author

Front-End development engineer, technology stack: React + Typescript + Mobx, also used Vue + Vuex for a while

๐Ÿ“ License

MIT

Copyright ยฉ 2020-present Rain120.

โ˜• Coffee or Tea

wechat-zhifubao-pay.png