Skip to content

Commit

Permalink
Merge branch 'feature/auto-versioning'
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Mar 2, 2022
2 parents 171463d + 887859d commit 7fef3fa
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 155 deletions.
27 changes: 17 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to Contribute

We want to thank you for sparing time to improve this project! Here are some guidelines for contributing:
We'd like to thank you for sparing time to improve this project! Here are some guidelines for contributing:

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.

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

1. Fork this project on GitHub and clone it locally.
2. Create a new branch from the default branch and give it a descriptive name (e.g., `my-new-feature`, `fix-a-bug`).
3. After completing the development, submit a new _Pull Request_.
2. Create a new branch from the default branch and give it a descriptive name (format: `feature/<add-new-feat>` / `fix/<fix-a-bug>`).
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.

## Modifying JavaScript

If your contribution involves JS modification, please read the following sections.
If your contribution involves JavaScript modification, please read the following sections.

### Inline Scripts

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

### External Scripts

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).
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:

During development, real-time debugging can be performed through the following commands:
```console
$ npm i
```

During JavaScript development, real-time debugging can be performed through the following commands:

Firstly, start a Jekyll server:

```console
$ bash tools/run.sh
```

Open another terminal tab and run:
And then open a new terminal tab and run:

```console
$ gulp dev # Type 'Ctrl + C' to stop
# Type 'Ctrl + C' to stop
$ npx gulp dev
```

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

---

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Commit Messages
on: pull_request

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!.editorconfig
!.nojekyll
!.travis.yml
!.husky

# bundler cache
_site
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit
33 changes: 32 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,43 @@
"url": "https://github.com/cotes2020/jekyll-theme-chirpy/issues"
},
"homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme",
"dependencies": {
"scripts": {
"prepare": "husky install"
},
"devDependencies": {
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-insert": "^0.5.0",
"gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2",
"husky": "^7.0.4",
"standard-version": "^9.3.2",
"uglify-js": "^3.14.3"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"standard-version": {
"skip": {
"commit": true,
"tag": true
},
"types": [{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Improvements"
}
]
}
}
106 changes: 0 additions & 106 deletions tools/bump.sh

This file was deleted.

Loading

0 comments on commit 7fef3fa

Please sign in to comment.