From 1968fb17913993d4b06bbc3bb9f6c9111f543942 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 1 Mar 2022 23:26:29 +0800 Subject: [PATCH] docs: update contributing guidelines --- .github/CONTRIBUTING.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 389502c6129..b35638af8be 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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. @@ -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/` / `fix/`). +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 ``), 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 ``), 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/`. ---