You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+33-10Lines changed: 33 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# How to Contribute
2
2
3
-
We want to thank you for sparing time to improve this project! Here are some guidelines for contributing:
3
+
We'd like to thank you for sparing time to improve this project! Here are some guidelines for contributing:
4
4
5
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.
6
6
@@ -9,34 +9,57 @@ To ensure that the blog design is not confused, this project does not accept sug
9
9
Generally, contribute to the project by:
10
10
11
11
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 (e.g., `my-new-feature`, `fix-a-bug`).
13
-
3. After completing the development, submit a new _Pull Request_.
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
14
15
15
## Modifying JavaScript
16
16
17
-
If your contribution involves JS modification, please read the following sections.
17
+
If your contribution involves JavaScript modification, please read the following sections.
18
18
19
19
### Inline Scripts
20
20
21
-
If you need to add comments to the inline JS (the JS code between the 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. And this will disrupt the structure of the compressed HTML.
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
22
23
23
### External Scripts
24
24
25
-
If you need to add or modify JavaScripts in the directory `_javascript`, you need to install [Gulp.js](https://gulpjs.com/docs/en/getting-started/quick-start).
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:
26
26
27
-
During development, real-time debugging can be performed through the following commands:
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:
28
34
29
35
```console
30
36
$ bash tools/run.sh
31
37
```
32
38
33
-
Open another terminal tab and run:
39
+
And then open a new terminal tab and run:
40
+
41
+
```console
42
+
# Type 'Ctrl + C' to stop
43
+
$ npx gulp dev
44
+
```
45
+
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
49
+
50
+
If you want to make sure your commits pass the CI check, you can refer to the following steps.
51
+
52
+
Install `commitlint` & `husky`:
34
53
35
54
```console
36
-
$ gulp dev # Type 'Ctrl + C' to stop
55
+
$ npm i -g @commitlint/{cli,config-conventional} husky
37
56
```
38
57
39
-
After debugging, run the command `gulp` (without any argument) will automatically output the compressed files to the directory `assests/js/dist/`.
0 commit comments