Thank you for contributing to PicGo-Doc~ Before submitting your contribution, be sure to check out the guide below.
You need to have Node.js installed like brew install node
(MacOS).
yarn is also required, which is a dependency manager for Node.js.
- Windows: install the
.msi
package here. - MacOS and Linux:
curl -o- -L https://yarnpkg.com/install.sh | bash
. - Use
yarn
to install dependencies in the project root path. We do not support to usenpm
to install dependencies, as this repo locks the dependencies' versions usingyarn.lock
.
You are recommended to create your branch in your forked repo.
- If your branch is to fix errors, you should use prefix
fix-
, e.g.fix-guide
. If your branch is to add new features, you should use prefixfeature-
, e.g.feature-en-lang
. - Use
yarn cz
trigger a commit normalization operation. - When the description is submitted, the format of the commit message is automatically checked to see if it meets the requirements. If the requirements are not met, an error will be reported. At this time, the reason for the error reporting needs to be checked, and then the modification will be submitted through
yarn cz
again until it is approved. git push origin [your branch]
to push your branch to remote.- Pull request your branch.
If you want to contribute to PicGo-Doc i18n and add a new language for PicGo:
- Create a folder in
docs/
directory such asdocs/en
, and struct files likedocs/zh
. - Start translating.
- Note that you should also change the inner link, e.g.
/zh/guide/config
should be changed to/en/guide/config
. - Update
themeConfig.locales
indocs/.vuepress/config.js
, update the sidebar and navigation of the document accordingly.
Add translation sidebar and top navigation bar correspondingly:
locales: {
// ...
'/zh/': {
sidebar: {
'/zh/guide/': getGuideSidebar('指南'),
},
nav: [
{
text: '指南',
link: '/zh/guide/'
},
{
text: '高级技巧',
link: '/zh/guide/advance'
}
]
},
'/en/': {
sidebar: {
'/en/guide/': getGuideSidebar('Guidelines'),
},
nav: [
{
text: 'Guidelines',
link: '/en/guide/'
},
{
text: 'Advance Usage',
link: '/en/guide/advance'
}
]
},
}
If you want to preview your translation:
- Run
yarn dev
to enable the document local development mode build, then you are able to find your pages athttp://localhost:8080/PicGo-Doc/
. - Use
docs/en
as an example, you can find your home page athttp://localhost:8080/PicGo-Doc/en/
, and find other pages athttp://localhost:8080/PicGo-Doc/en/guide
, etc.