Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/production'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/ISSUE_TEMPLATE/feature_request.md
#	.github/ISSUE_TEMPLATE/help_wanted.md
#	.github/ISSUE_TEMPLATE/question.md
#	.github/workflows/codeql.yml
#	CHANGELOG.md
#	README.md
#	_config.yml
#	_javascript/commons/back-to-top.js
#	_javascript/commons/mode-toggle.js
#	_javascript/commons/scroll-helper.js
#	_javascript/commons/search-display.js
#	_javascript/commons/sidebar.js
#	_javascript/commons/topbar-switcher.js
#	_javascript/commons/topbar-title.js
#	_javascript/utils/clipboard.js
#	_javascript/utils/locale-datetime.js
#	_javascript/utils/smooth-scroll.js
#	_posts/2019-08-08-write-a-new-post.md
#	_posts/2019-08-09-getting-started.md
#	assets/js/dist/categories.min.js
#	assets/js/dist/commons.min.js
#	assets/js/dist/home.min.js
#	assets/js/dist/misc.min.js
#	assets/js/dist/page.min.js
#	assets/js/dist/post.min.js
#	package.json
  • Loading branch information
linkliu committed Mar 21, 2023
2 parents 3fa02bb + 61d9c22 commit 4db7bb2
Show file tree
Hide file tree
Showing 94 changed files with 2,022 additions and 1,682 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
11 changes: 7 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ about: Suggest an idea for this project
labels: enhancement
---

We sincerely recommend that you first complete the following checklist:
**NOTE:** Before you start, the following should be completed.

- Read the [tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
- No similar [issue](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue)(including closed ones) exists
- This PR is built on top of the latest code in the `master` branch.
- 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
26 changes: 15 additions & 11 deletions .github/ISSUE_TEMPLATE/help_wanted.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
---
name: Help Wanted
about: Need help
about: Need help that is not covered in the tutorial
labels: 'help wanted'
---

We sincerely recommend that you first complete the following checklist:
**NOTE:** Before you start, the following should be completed.

- Read the [tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
- No similar [issue](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue)(including closed ones) exists
- Try to find the answer on [Jekyll Forum](https://talk.jekyllrb.com/) and [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll).
- The ask is based on the latest code of the `master` branch.
- 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. -->

## What you have tried
## Operations you have already tried

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

<!--
Describe the steps you went through, such as the configuration process.
## Logs/Screenshots

If needed, please attach output logs, screenshots, etc. to describe your issue.
-->
<!-- If applicable, add logs/screenshots to help explain your problem. -->
15 changes: 14 additions & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
---
name: Question
about: Ask whatever you want
about: Issues that differ from other templates
labels: question
---

**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 question in detail. -->
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
40 changes: 20 additions & 20 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'CodeQL'
name: "CodeQL"

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

jobs:
analyze:
Expand All @@ -20,25 +20,25 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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 }}'
# 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
# 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 }}'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
2 changes: 1 addition & 1 deletion .github/workflows/pages-deploy.yml.hook
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
uses: actions/configure-pages@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/style-lint.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: 'Style Lint'
name: "Style Lint"

on:
push:
branches-ignore:
- 'production'
- 'docs'
- "production"
- "docs"
paths:
- '_sass/**/*.scss'
- "_sass/**/*.scss"
pull_request:
paths:
- '_sass/**/*.scss'
- "_sass/**/*.scss"

jobs:
stylelint:
Expand Down
29 changes: 15 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# hidden files
.*
!.git*
!.editorconfig
!.nojekyll
!.husky
!.commitlintrc.json
!.versionrc.json
!.stylelintrc.json

# bundler cache
_site
# Bundler cache
.bundle
vendor
Gemfile.lock

# rubygem
# Jekyll cache
.jekyll-cache
_site

# RubyGems
*.gem

# npm dependencies
# NPM dependencies
node_modules
package-lock.json

# IDE configurations
.idea
.vscode

# Misc
assets/js/dist
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "none"
}
7 changes: 6 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"alpha-value-notation": "number",
"selector-not-notation": "simple",
"color-hex-length": "long",
"declaration-block-single-line-max-declarations": 3
"declaration-block-single-line-max-declarations": 3,
"scss/operator-no-newline-after": null,
"rule-empty-line-before": [
"always",
{ "ignore": ["after-comment", "first-nested", "inside-block"] }
]
}
}
Loading

0 comments on commit 4db7bb2

Please sign in to comment.