Skip to content

Commit 4c45f37

Browse files
committed
Merge branch 'master' into production
2 parents 3969b28 + baad801 commit 4c45f37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1223
-750
lines changed

.commitlintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"body-max-line-length": [0, "always"]
4+
}
5+
}

.github/CONTRIBUTING.md

Lines changed: 33 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,57 @@ 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:
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`:
3453

3554
```console
36-
$ gulp dev # Type 'Ctrl + C' to stop
55+
$ npm i -g @commitlint/{cli,config-conventional} husky
3756
```
3857

39-
After debugging, run the command `gulp` (without any argument) will automatically output the compressed files to the directory `assests/js/dist/`.
58+
And then enable `husky`:
59+
60+
```console
61+
$ husky install
62+
```
4063

4164
---
4265

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ Steps to reproduce the behavior:
3535

3636
<!-- If applicable, add screenshots to help explain your problem. -->
3737

38-
### Software
39-
40-
<!-- Please complete the following information -->
41-
- Ruby version: <!-- by running: `ruby -v` -->
42-
- Gem version: <!-- by running: `gem -v`-->
43-
- Bundler version: <!-- by running: `bundle -v`-->
44-
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
45-
- Theme version: <!-- by running: `gem list | grep jekyll-theme-chirpy` -->
38+
### Environment
39+
40+
| Command | Version |
41+
|-----------------------------------|---------|
42+
| `ruby -v` | |
43+
| `gem -v` | |
44+
| `bundle -v` | |
45+
| `bundle exec jekyll -v` | |
46+
| `bundle info jekyll-theme-chirpy` | |
4647

4748
### Desktop
4849

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Continuous Integration'
1+
name: 'CI'
22
on:
33
push:
44
branches-ignore:
@@ -18,23 +18,20 @@ on:
1818
- '**'
1919

2020
jobs:
21-
ci:
22-
runs-on: ${{ matrix.os }}
21+
build:
22+
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
os: [ubuntu-latest, macos-latest]
26-
25+
ruby: [2.5, 2.6, 2.7, 3]
2726
steps:
2827
- name: Checkout
2928
uses: actions/checkout@v2
3029
with:
3130
fetch-depth: 0 # for posts's lastmod
32-
3331
- name: Setup Ruby
3432
uses: ruby/setup-ruby@v1
3533
with:
36-
ruby-version: 2.7
34+
ruby-version: ${{ matrix.ruby }}
3735
bundler-cache: true
38-
3936
- name: Test Site
4037
run: bash tools/deploy.sh --dry-run

.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

.github/workflows/pages-deploy.yml.hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Automatic build'
22
on:
33
push:
44
branches:
5-
- main
5+
- master
66
paths-ignore:
77
- .gitignore
88
- README.md

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
!.editorconfig
55
!.nojekyll
66
!.travis.yml
7+
!.husky
8+
!.commitlintrc.json
9+
!.versionrc.json
710

811
# bundler cache
912
_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 -x $(npm root -g)/@commitlint/config-conventional --edit

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131

3232
stages:
3333
- name: Upgrade
34-
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
34+
if: branch = production
3535
- name: Starter
36-
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
36+
if: branch = production
3737
- name: Docs
3838
if: branch = docs
3939

.versionrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"skip": {
3+
"commit": true,
4+
"tag": true
5+
},
6+
"types": [
7+
{
8+
"type": "feat",
9+
"section": "Features"
10+
},
11+
{
12+
"type": "fix",
13+
"section": "Bug Fixes"
14+
},
15+
{
16+
"type": "perf",
17+
"section": "Improvements"
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)