You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+32-5Lines changed: 32 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,42 @@
1
1
# How to Contribute
2
2
3
-
I want to thank you for sparing time to improve this project! Here are some guidelines for contributing:
3
+
We want to thank you for sparing time to improve this project! Here are some guidelines for contributing:
4
4
5
-
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.
5
+
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.
6
+
7
+
## Basic Process
6
8
7
9
Generally, contribute to the project by:
8
10
9
11
1. Fork this project on GitHub and clone it locally.
10
-
2. Create a new branch from `master` and give it a descriptive name (e.g., `my-new-feature`, `fix-a-bug`).
11
-
3. After completing the development, commit and push to remote.
12
-
4. Submit a new pull request.
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_.
14
+
15
+
## Modifying JavaScript
16
+
17
+
If your contribution involves JS modification, please read the following sections.
18
+
19
+
### Inline Scripts
20
+
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.
22
+
23
+
### External Scripts
24
+
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).
26
+
27
+
During development, real-time debugging can be performed through the following commands:
28
+
29
+
```console
30
+
$ bash tools/run.sh
31
+
```
32
+
33
+
Open another terminal tab and run:
34
+
35
+
```console
36
+
$ gulp dev # Type 'Ctrl + C' to stop
37
+
```
38
+
39
+
After debugging, run the command `gulp` (without any argument) will automatically output the compressed files to the directory `assests/js/dist/`.
EN / [中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
4
-
5
-
</div>
6
-
7
1
<divalign="center">
8
2
9
3
# Chirpy Jekyll Theme
@@ -25,99 +19,48 @@
25
19
## Features
26
20
27
21
- Localized Layout
28
-
-Configurable Theme Mode
22
+
-Dark/Light Theme Mode
29
23
- Pinned Posts
30
24
- Hierarchical Categories
31
25
- Last Modified Date for Posts
32
26
- Table of Contents
33
-
-Automatically Recommend Related Posts
27
+
-Auto-generated Related Posts
34
28
- Syntax Highlighting
35
29
- Mathematical Expressions
36
30
- Mermaid Diagram & Flowchart
31
+
- Disqus/Utterances Comments
37
32
- Search
38
33
- Atom Feeds
39
-
- Disqus Comments
40
34
- Google Analytics
41
-
- GA Pageviews Reporting (Advanced)
35
+
- GA Pageviews Reporting
42
36
- SEO & Performance Optimization
43
37
44
-
## Prerequisites
45
-
46
-
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
47
-
48
-
## Installation
49
-
50
-
### Creating a New Site
51
-
52
-
There are two ways to create a new repository for this theme:
53
-
54
-
-[**Using the Chirpy Starter**](#option-1-using-the-chirpy-starter) - Easy to upgrade, isolates irrelevant project files so you can focus on writing.
55
-
-[**Forking on GitHub**](#option-2-forking-on-github) - Convenient for custom development, but difficult to upgrade. Unless you are familiar with Jekyll and are determined to tweak or contribute to this project, this approach is not recommended.
56
-
57
-
#### Option 1. Using the Chirpy Starter
58
-
59
-
Create a new repository from the [**Chirpy Starter**][use-starter] and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
60
-
61
-
#### Option 2. Forking on GitHub
62
-
63
-
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and rename it to `<GH_USERNAME>.github.io`. Please note that the default branch code is in development. If you want the site to be stable, please switch to the [latest tag][latest-tag] and start writing.
64
-
65
-
And then execute:
66
-
67
-
```console
68
-
$ bash tools/init.sh
69
-
```
70
38
71
-
> **Note**: If you don't want to deploy your site on GitHub Pages, append option `--no-gh` at the end of the above command.
39
+
## Quick Start
72
40
73
-
The above command will:
41
+
Before starting, please follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
74
42
75
-
1.Removes some files or directories from your repository:
43
+
### Step 1. Creating a New Site
76
44
77
-
-`.travis.yml`
78
-
- files under `_posts`
79
-
- folder `docs`
45
+
Create a new repository from the [**Chirpy Starter**](https://github.com/cotes2020/chirpy-starter/generate) and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
80
46
81
-
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise, set up the GitHub Action workflow by removing the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
82
-
83
-
3. Removes item `Gemfile.lock` from `.gitignore`.
84
-
85
-
4. Creates a new commit to save the changes automatically.
86
-
87
-
### Installing Dependencies
47
+
### Step 2. Installing Dependencies
88
48
89
49
Before running for the first time, go to the root directory of your site, and install dependencies as follows:
90
50
91
51
```console
92
52
$ bundle
93
53
```
94
54
95
-
## Usage
96
-
97
-
### Configuration
98
-
99
-
Update the variables of `_config.yml` as needed. Some of them are typical options:
100
-
101
-
-`url`
102
-
-`avatar`
103
-
-`timezone`
104
-
-`lang`
105
-
106
-
### Customing Stylesheet
107
-
108
-
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
55
+
### Step 3. Running Local Server
109
56
110
-
Starting from [`v4.1.0`][chirpy-4.1.0], if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
111
-
112
-
### Running Local Server
113
-
114
-
You may want to preview the site contents before publishing, so just run it by:
57
+
Run the following command in the root directory of the site:
115
58
116
59
```console
117
60
$ bundle exec jekyll s
118
61
```
119
62
120
-
Or run the site on Docker with the following command:
63
+
Or run with Docker:
121
64
122
65
```console
123
66
$ docker run -it --rm \
@@ -128,91 +71,13 @@ $ docker run -it --rm \
128
71
129
72
After a while, the local service will be published at _<http://127.0.0.1:4000>_.
130
73
131
-
### Deployment
132
-
133
-
Before the deployment begins, check out the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base URL on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starts with a slash, e.g, `/project-name`.
134
-
135
-
Now you can choose ONE of the following methods to deploy your Jekyll site.
136
-
137
-
#### Deploy by Using Github Actions
138
-
139
-
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the GitHub Pages service.
140
-
141
-
Quickly check the files needed for GitHub Actions build:
142
-
143
-
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [sample file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
144
-
145
-
- Ensure your Jekyll site has file `tools/deploy.sh`. Otherwise, copy it from here to your Jekyll site.
146
-
147
-
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lock file:
148
-
149
-
```console
150
-
$ bundle lock --add-platform x86_64-linux
151
-
```
152
-
153
-
After the above steps, rename your repository to `<GH_USERNAME>.github.io` on GitHub.
154
-
155
-
Now publish your Jekyll site by:
156
-
157
-
1. Push any commit to remote to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
158
-
159
-
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
3. Visit your website at the address indicated by GitHub.
164
-
165
-
#### Manually Build and Deploy
166
-
167
-
On self-hosted servers, you cannot enjoy the convenience of **GitHub Actions**. Therefore, you should build the site on your local machine and then upload the site files to the server.
168
-
169
-
Go to the root of the source project, and build your site as follows:
170
-
171
-
```console
172
-
$ JEKYLL_ENV=production bundle exec jekyll b
173
-
```
174
-
175
-
Or build the site on Docker:
176
-
177
-
```console
178
-
$ docker run -it --rm \
179
-
--env JEKYLL_ENV=production \
180
-
--volume="$PWD:/srv/jekyll" \
181
-
jekyll/jekyll \
182
-
jekyll build
183
-
```
184
-
185
-
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to the target server.
186
-
187
-
### Upgrading
188
-
189
-
It depends on how you use the theme:
190
-
191
-
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the theme gem, for example:
192
-
193
-
```diff
194
-
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
195
-
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
196
-
```
197
-
198
-
And then execute the following command:
199
-
200
-
```console
201
-
$ bundle update jekyll-theme-chirpy
202
-
```
203
-
204
-
As the version upgrades, the critical files (for details, see the [Startup Template][starter]) and configuration options will change. Please refer to the [Upgrade Guide](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide) to keep your repo's files in sync with the latest version of the theme.
205
-
206
-
- If you forked from the source project (there will be `gemspec` in the `Gemfile` of your site), then merge the [latest upstream tags][latest-tag] into your Jekyll site to complete the upgrade.
207
-
The merge is likely to conflict with your local modifications. Please be patient and careful to resolve these conflicts.
208
-
209
74
## Documentation
210
75
211
-
For more details and a better reading experience, please check out the [tutorials on the demo site](https://cotes2020.github.io/chirpy-demo/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Please note that the tutorials on the demo website or Wiki are based on the latest release, and the features of `master` branch are usually ahead of the documentation.
76
+
For more details on usage, please refer to the tutorial on the [demo website](https://cotes2020.github.io/chirpy-demo/). At the same time, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Please note that the tutorial is based on the [latest release](https://github.com/cotes2020/jekyll-theme-chirpy/releases), and the features of the default branch are usually ahead of the documentation.
212
77
213
78
## Contributing
214
79
215
-
The old saying, "Two heads are better than one." Consequently, welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
80
+
Welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
216
81
217
82
## Credits
218
83
@@ -234,13 +99,6 @@ If you like this theme or find it helpful, please consider sponsoring me, becaus
234
99
235
100
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
0 commit comments