|
1 | 1 | # How to Contribute |
2 | 2 |
|
3 | | -We'd like to thank you for sparing time to improve this project! Here are some guidelines for contributing: |
| 3 | +:tada: We really appreciate you taking the time to improve this project! :tada: |
4 | 4 |
|
5 | | -To ensure that the blog design is not confused, this project does not accept suggestions for design changes, such as color scheme, fonts, typography, etc. If your request is about an enhancement, it is recommended to first submit a [_Feature Request_](https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?labels=enhancement&template=feature_request.md) issue to discuss whether your idea fits the project. |
| 5 | +To ensure that the blog design is not confusing, this project does not accept |
| 6 | +suggestions for design changes, such as color scheme, fonts, typography, etc. |
| 7 | +If your request is about an enhancement, it is recommended to first submit a |
| 8 | +[Feature Request][pr-issue] issue to discuss whether your idea fits the project. |
6 | 9 |
|
7 | | -## Basic Process |
8 | | - |
9 | | -Generally, contribute to the project by: |
| 10 | +Basically, you can follow these steps to complete the contribution. |
10 | 11 |
|
11 | 12 | 1. Fork this project on GitHub and clone it locally. |
12 | | -2. Create a new branch from the default branch and give it a descriptive name (format: `feature/<add-new-feat>` / `fix/<fix-a-bug>`). |
13 | | -3. After completing the development, submit a new _Pull Request_. Note that the commit message must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), otherwise it will fail the PR check. |
14 | | - |
15 | | -## Modifying JavaScript |
16 | | - |
17 | | -If your contribution involves JavaScript modification, please read the following sections. |
18 | | - |
19 | | -### Inline Scripts |
20 | | - |
21 | | -If you need to add comments to the inline JavaScript (the code between the HTML tags `<script>` and `</script>`), please use `/* */` instead of two slashes `//`. Because the HTML will be compressed by [jekyll-compress-html](https://github.com/penibelst/jekyll-compress-html) during deployment, but it cannot handle the `//` properly, which will disrupt the structure of the compressed HTML. |
22 | | - |
23 | | -### External Scripts |
| 13 | +2. Create a new branch from the default branch and give it a descriptive name |
| 14 | + (format: `feature/<add-new-feat>` or `fix/<fix-a-bug>`). |
| 15 | +3. After completing development, create a [Conventional Commit][cc] with git. |
| 16 | + (See also: ["Verify the commits"](#verify-the-commits)) |
| 17 | +4. Create a [Pull Request][gh-pr]. |
24 | 18 |
|
25 | | -If you need to add/change/delete the JavaScript in the directory `_javascript/`, setting up [`Node.js`](https://nodejs.org/) and [`npx`](https://www.npmjs.com/package/npx) is a requirement. And then install the development dependencies: |
| 19 | +## Make sure you can pass the CI tests |
26 | 20 |
|
27 | | -```console |
28 | | -$ npm i |
29 | | -``` |
30 | | - |
31 | | -During JavaScript development, real-time debugging can be performed through the following commands: |
32 | | - |
33 | | -Firstly, start a Jekyll server: |
| 21 | +This project has [CI][ci] turned on. In order for your [PR][gh-pr] to pass the test, |
| 22 | +please read the following. |
34 | 23 |
|
| 24 | +### Check the core functionality |
| 25 | + |
35 | 26 | ```console |
36 | | -$ bash tools/run |
| 27 | +bash ./tools/test |
37 | 28 | ``` |
38 | 29 |
|
39 | | -And then open a new terminal tab and run: |
| 30 | +### Check the SASS syntax style |
40 | 31 |
|
41 | 32 | ```console |
42 | | -# Type 'Ctrl + C' to stop |
43 | | -$ npx gulp dev |
| 33 | +npm test |
44 | 34 | ``` |
45 | 35 |
|
46 | | -After debugging, run the command `npx gulp` (without any argument) will automatically output the compressed files to the directory `assets/js/dist/`. |
47 | | - |
48 | | -## Verify the commit messages |
| 36 | +### Verify the commits |
49 | 37 |
|
50 | | -If you want to make sure your commits pass the CI check, you can refer to the following steps. |
| 38 | +Before you create a git commit, please complete the following setup. |
51 | 39 |
|
52 | 40 | Install `commitlint` & `husky`: |
53 | 41 |
|
54 | 42 | ```console |
55 | | -$ npm i -g @commitlint/{cli,config-conventional} husky |
| 43 | +npm i -g @commitlint/{cli,config-conventional} husky |
56 | 44 | ``` |
57 | 45 |
|
58 | 46 | And then enable `husky`: |
59 | 47 |
|
60 | 48 | ```console |
61 | | -$ husky install |
| 49 | +husky install |
62 | 50 | ``` |
63 | 51 |
|
64 | | ---- |
65 | | - |
66 | | -:tada: Your volunteering will make the open-source world more beautiful, thanks again! :tada: |
| 52 | +[pr-issue]: https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?labels=enhancement&template=feature_request.md |
| 53 | +[gh-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests |
| 54 | +[cc]: https://www.conventionalcommits.org/ |
| 55 | +[ci]: https://en.wikipedia.org/wiki/Continuous_integration |
0 commit comments