Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Mar 17, 2023
2 parents 7a60171 + 0d9cec6 commit 61d9c22
Show file tree
Hide file tree
Showing 104 changed files with 2,198 additions and 1,890 deletions.
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/browserslist/browserslist#browserslistrc

last 2 versions
> 0.2%
not dead
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.js]
indent_size = 4
[*.{js,css,scss}]
quote_type = single

[*.{yml,yaml}]
quote_type = double

[*.md]
trim_trailing_whitespace = false
65 changes: 27 additions & 38 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,55 @@
# How to Contribute

We'd like to thank you for sparing time to improve this project! Here are some guidelines for contributing:
:tada: We really appreciate you taking the time to improve this project! :tada:

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.
To ensure that the blog design is not confusing, 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][pr-issue] issue to discuss whether your idea fits the project.

## Basic Process

Generally, contribute to the project by:
Basically, you can follow these steps to complete the contribution.

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 (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 JavaScript modification, please read the following sections.

### Inline Scripts

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
2. Create a new branch from the default branch and give it a descriptive name
(format: `feature/<add-new-feat>` or `fix/<fix-a-bug>`).
3. After completing development, create a [Conventional Commit][cc] with git.
(See also: ["Verify the commits"](#verify-the-commits))
4. Create a [Pull Request][gh-pr].

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:
## Make sure you can pass the CI tests

```console
$ npm i
```

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

Firstly, start a Jekyll server:
This project has [CI][ci] turned on. In order for your [PR][gh-pr] to pass the test,
please read the following.

### Check the core functionality

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

And then open a new terminal tab and run:
### Check the SASS syntax style

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

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

## Verify the commit messages
### Verify the commits

If you want to make sure your commits pass the CI check, you can refer to the following steps.
Before you create a git commit, please complete the following setup.

Install `commitlint` & `husky`:

```console
$ npm i -g @commitlint/{cli,config-conventional} husky
npm i -g @commitlint/{cli,config-conventional} husky
```

And then enable `husky`:

```console
$ husky install
husky install
```

---

:tada: Your volunteering will make the open-source world more beautiful, thanks again! :tada:
[pr-issue]: https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?labels=enhancement&template=feature_request.md
[gh-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
[cc]: https://www.conventionalcommits.org/
[ci]: https://en.wikipedia.org/wiki/Continuous_integration
33 changes: 18 additions & 15 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ name: Bug Report
about: Create a report to help us improve
---

<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
**NOTE:** Before you start, the following should be completed.

## Checklist
- Read [tutorial][tutorial] to understand the usage and the correct effect of functional design.
- Make sure no [similar issue(including closed ones)][issues] exists.
- Make sure the bug is found in the latest code of the `master` branch.

<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->

- [ ] I have read the [tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
- [ ] There are no similar reports on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
- [ ] I found the bug on the latest code of the `master` branch.
[tutorial]: https://cotes2020.github.io/chirpy-demo/categories/tutorial/
[issues]: https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue

## Describe the bug

<!-- A clear and concise description of what the bug is. -->

### To Reproduce
## To Reproduce

Steps to reproduce the behavior:
<!--
Expand All @@ -27,15 +26,15 @@ Steps to reproduce the behavior:
4. See error
-->

### Expected behavior
## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

### Screenshots
## Logs/Screenshots

<!-- If applicable, add screenshots to help explain your problem. -->
<!-- If applicable, add logs/screenshots to help explain your problem. -->

### Environment
## Environment

| Command | Version |
|-----------------------------------|---------|
Expand All @@ -45,21 +44,25 @@ Steps to reproduce the behavior:
| `bundle exec jekyll -v` | |
| `bundle info jekyll-theme-chirpy` | |

<!-- If necessary, uncomment and fill in the following list:
### Desktop
<!-- If necessary, uncomment and fill in the following list:
- OS: [e.g. macOS 10.15.6]
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
-->

<!-- If necessary, uncomment and fill in the following list:
### Smartphone
<!-- If necessary, uncomment and fill in the following list:
- Device: [e.g. iPhone 6]
- OS: [e.g. iOS 13.6.1]
- Browser: [e.g. Chrome 22]
-->

### Additional context
## Additional context

<!-- Add any other context about the problem here. -->
14 changes: 6 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ about: Suggest an idea for this project
labels: enhancement
---

<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
**NOTE:** Before you start, the following should be completed.

## Checklist

<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
- [ ] There is no similar request on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
- [ ] I was in the `master` branch of the latest code.
- Read [tutorial][tutorial] to understand the usage and the correct effect of functional design.
- Make sure no [similar issue(including closed ones)][issues] exists.
- Make sure the request is based on the latest code in the `master` branch.

[tutorial]: https://cotes2020.github.io/chirpy-demo/categories/tutorial/
[issues]: https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue

## Is your feature request related to a problem? Please describe

Expand Down
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/help_wanted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Help Wanted
about: Need help that is not covered in the tutorial
labels: 'help wanted'
---

**NOTE:** Before you start, the following should be completed.

- Read [tutorial][tutorial] to understand the usage and the correct effect of functional design.
- Make sure no [similar issue(including closed ones)][issues] exists.
- Try to find the answer on [Jekyll Forum][forum] and [StackOverflow][stack_overflow].

[tutorial]: https://cotes2020.github.io/chirpy-demo/categories/tutorial/
[issues]: https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue
[forum]: https://talk.jekyllrb.com/
[stack_overflow]: https://stackoverflow.com/questions/tagged/jekyll

## Description

<!-- Please describe your need in detail. -->

## Operations you have already tried

<!-- Describe the effort you went through. -->

## Logs/Screenshots

<!-- If applicable, add logs/screenshots to help explain your problem. -->
18 changes: 9 additions & 9 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
name: Question
about: Ask whatever you want
about: Issues that differ from other templates
labels: question
---

<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
**NOTE:** Before you start, the following should be completed.

## Checklist
- Read [tutorial][tutorial] to understand the usage and the correct effect of functional design.
- Make sure no [similar issue(including closed ones)][issues] exists.
- Try to find the answer on [Jekyll Forum][forum] and [StackOverflow][stack_overflow].

<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->

- [ ] I have read the [newlest tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
- [ ] There is no similar question on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
- [ ] I have tried to find the answer on [Jekyll Forum](https://talk.jekyllrb.com/) and [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll).
- [ ] My question is based on the latest code of the `master` branch.
[tutorial]: https://cotes2020.github.io/chirpy-demo/categories/tutorial/
[issues]: https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue
[forum]: https://talk.jekyllrb.com/
[stack_overflow]: https://stackoverflow.com/questions/tagged/jekyll

## Description

Expand Down
8 changes: 0 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,3 @@ Please describe the tests that you ran to verify your changes. Provide instructi
- Ruby version: <!-- by running: `ruby -v` -->
- Bundler version: <!-- by running: `bundle -v`-->
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->

### Checklist

<!-- Select checkboxes by change the "[ ]" to "[x]" -->
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
12 changes: 12 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

## Supported Versions

| Version | Supported |
|---------| ------------------ |
| 5.x | :white_check_mark: |
| < 5.0.0 | :x: |

## Reporting a Vulnerability

If you find a vulnerability, please report it to `cotes.chung@gmail.com`. We will try our best to respond within a week. Thank you for your time!
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: 'CI'
name: "CI"
on:
push:
branches-ignore:
- 'production'
- 'docs'
- "production"
- "docs"
paths-ignore:
- '.github/**'
- '!.github/workflows/ci.yml'
- '.gitignore'
- 'README.md'
- 'LICENSE'
- ".github/**"
- "!.github/workflows/ci.yml"
- ".gitignore"
- "README.md"
- "LICENSE"
pull_request:
paths:
- '**'
- "**"

jobs:
build:
Expand All @@ -26,13 +26,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # for posts's lastmod
fetch-depth: 0 # for posts's lastmod

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Setup Node
uses: actions/setup-node@v3

- name: Build Assets
run: npm i && npm run build

- name: Test Site
run: bash tools/test
44 changes: 44 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "CodeQL"

on:
push:
paths: ["**.js"]
pull_request:
paths: ["**.js"]
schedule:
- cron: "0 0 * * 5"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript"]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: "${{ matrix.language }}"

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
Loading

0 comments on commit 61d9c22

Please sign in to comment.