Skip to content

Commit 7fef3fa

Browse files
committed
Merge branch 'feature/auto-versioning'
2 parents 171463d + 887859d commit 7fef3fa

File tree

7 files changed

+247
-155
lines changed

7 files changed

+247
-155
lines changed

.github/CONTRIBUTING.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to Contribute
22

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:
44

55
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.
66

@@ -9,34 +9,41 @@ To ensure that the blog design is not confused, this project does not accept sug
99
Generally, contribute to the project by:
1010

1111
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.
1414

1515
## Modifying JavaScript
1616

17-
If your contribution involves JS modification, please read the following sections.
17+
If your contribution involves JavaScript modification, please read the following sections.
1818

1919
### Inline Scripts
2020

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.
2222

2323
### External Scripts
2424

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:
2626

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:
2834

2935
```console
3036
$ bash tools/run.sh
3137
```
3238

33-
Open another terminal tab and run:
39+
And then open a new terminal tab and run:
3440

3541
```console
36-
$ gulp dev # Type 'Ctrl + C' to stop
42+
# Type 'Ctrl + C' to stop
43+
$ npx gulp dev
3744
```
3845

39-
After debugging, run the command `gulp` (without any argument) will automatically output the compressed files to the directory `assests/js/dist/`.
46+
After debugging, run the command `npx gulp` (without any argument) will automatically output the compressed files to the directory `assets/js/dist/`.
4047

4148
---
4249

.github/workflows/commitlint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint Commit Messages
2+
on: pull_request
3+
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
fetch-depth: 0
11+
- uses: wagoid/commitlint-github-action@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
!.editorconfig
55
!.nojekyll
66
!.travis.yml
7+
!.husky
78

89
# bundler cache
910
_site

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit

package.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,43 @@
1212
"url": "https://github.com/cotes2020/jekyll-theme-chirpy/issues"
1313
},
1414
"homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme",
15-
"dependencies": {
15+
"scripts": {
16+
"prepare": "husky install"
17+
},
18+
"devDependencies": {
19+
"@commitlint/cli": "^16.2.1",
20+
"@commitlint/config-conventional": "^16.2.1",
1621
"gulp": "^4.0.2",
1722
"gulp-concat": "^2.6.1",
1823
"gulp-insert": "^0.5.0",
1924
"gulp-rename": "^2.0.0",
2025
"gulp-uglify": "^3.0.2",
26+
"husky": "^7.0.4",
27+
"standard-version": "^9.3.2",
2128
"uglify-js": "^3.14.3"
29+
},
30+
"commitlint": {
31+
"extends": [
32+
"@commitlint/config-conventional"
33+
]
34+
},
35+
"standard-version": {
36+
"skip": {
37+
"commit": true,
38+
"tag": true
39+
},
40+
"types": [{
41+
"type": "feat",
42+
"section": "Features"
43+
},
44+
{
45+
"type": "fix",
46+
"section": "Bug Fixes"
47+
},
48+
{
49+
"type": "perf",
50+
"section": "Improvements"
51+
}
52+
]
2253
}
2354
}

tools/bump.sh

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)