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/PULL_REQUEST_TEMPLATE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Please select the desired item checkbox and change it to "[x]", then delete opti
22
22
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
23
23
-->
24
24
25
-
-[ ] I have run `bash ./tools/build.sh && bash ./tools/test.sh` (at the root of the project) locally and passed
25
+
-[ ] I have run `bash ./tools/test.sh --build` (at the root of the project) locally and passed
26
26
-[ ] I have tested this feature in the browser
27
27
28
28
### Test Configuration
@@ -41,4 +41,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi
41
41
-[ ] I have made corresponding changes to the documentation
42
42
-[ ] My changes generate no new warnings
43
43
-[ ] I have added tests that prove my fix is effective or that my feature works
44
-
-[ ] Any dependent changes have been merged and published in downstream modules
44
+
-[ ] Any dependent changes have been merged and published in downstream modules
Copy file name to clipboardExpand all lines: README.md
+9-30Lines changed: 9 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,32 +58,16 @@ $ bundle install
58
58
59
59
`bundle` will automatically install all the dependencies specified by `Gemfile`.
60
60
61
-
In order to generate some extra files (_categories_, _tags_ and _last modified list_), we need to use some tool scripts. And they require dependency package [yq](https://github.com/mikefarah/yq#install) to be installed. What's more, if your machine is running Debian or macOS, you also need to install [GNU coreutils](https://www.gnu.org/software/coreutils/).
62
-
63
-
- on Debian:
64
-
65
-
```console
66
-
$ sudo apt-get install coreutils
67
-
```
68
-
69
-
- on macOS:
70
-
71
-
```console
72
-
$ brew install coreutils
73
-
```
74
-
75
61
### Setting up Docker environment (optional)
76
62
77
63
If you're a loyal fan of [**Docker**](https://www.docker.com/) or just too lazy to install the packages mentioned in [_Setting up the local envrionment_](#setting-up-the-local-envrionment), please make sure you have **Docker Engine** installed and running, and then get Docker image `jekyll/jekyll` from Docker Hub by the following command:
78
64
79
65
```console
80
-
$ docker pull jekyll/jekyll:latest
66
+
$ docker pull jekyll/jekyll
81
67
```
82
68
83
69
## Usage
84
70
85
-
Running [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) requires some extra files, which cannot be generated by Jekyll native commands, so please strictly follow the methods mentioned below to run or deploy your website.
86
-
87
71
### Initialization
88
72
89
73
Go to the root directory of the project and start initialization:
@@ -120,26 +104,22 @@ Generally, go to `_config.yml` and configure the variables as needed. Some of th
120
104
You may want to preview the site contents before publishing, so just run it by:
121
105
122
106
```terminal
123
-
$ bash tools/run.sh
107
+
$ bundle exec jekyll s
124
108
```
125
109
126
110
Then open a browser and visit to <http://localhost:4000>.
127
111
128
-
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
129
-
130
112
### Run on Docker
131
113
132
114
Run the site on Docker with the following command:
133
115
134
116
```terminal
135
-
$ docker run --rm -it \
117
+
$ docker run -it --rm \
136
118
--volume="$PWD:/srv/jekyll" \
137
119
-p 4000:4000 jekyll/jekyll \
138
-
bash tools/run.sh --docker
120
+
jekyll serve
139
121
```
140
122
141
-
Please note that on Docker containers, you'll lose the real-time refresh feature.
142
-
143
123
### Deployment
144
124
145
125
Before the deployment begins, checkout 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 starting with a slash. For example, `/project`.
@@ -148,7 +128,7 @@ Assuming you have already gone through the [initialization](#initialization), yo
148
128
149
129
#### Deploy on GitHub Pages
150
130
151
-
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using tool scripts 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 Pages service.
131
+
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 Pages service.
152
132
153
133
1. Push any commit to `origin/master` 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.
154
134
@@ -164,18 +144,17 @@ On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Acti
164
144
Go to the root of the source project, build your site by:
165
145
166
146
```console
167
-
$ bash tools/build.sh
147
+
$ JEKYLL_ENV=production bundle exec jekyll b
168
148
```
169
149
170
-
> **Note**: The output path can be specified with the option `-d`.
171
-
172
150
Or, build the site with Docker by:
173
151
174
152
```terminal
175
-
$ docker run --rm -it \
153
+
$ docker run -it --rm \
154
+
--env JEKYLL_ENV=production \
176
155
--volume="$PWD:/srv/jekyll" \
177
156
jekyll/jekyll \
178
-
bash tools/build.sh --docker
157
+
jekyll build
179
158
```
180
159
181
160
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 your web server.
Copy file name to clipboardExpand all lines: _posts/2019-08-08-write-a-new-post.md
+2-58Lines changed: 2 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,67 +31,13 @@ In order to accurately record the release date of a post, you should not only se
31
31
32
32
### Categories and Tags
33
33
34
-
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity.
35
-
36
-
The list of posts belonging to the same *category*/*tag* is recorded on a separate page. At the same time, the number of these *category*/*tag* type pages is equal to the number of `categories` / `tags` elements for all posts, which means that the two number must be exactly the same.
37
-
38
-
For instance, let's say there is a post with front matter:
34
+
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity. For instance:
39
35
40
36
```yaml
41
37
categories: [Animal, Insect]
42
-
tags: bee
43
-
```
44
-
45
-
Then we should have two *category* type pages placed in folder `categories` of root and one *tag* type page placed in folder `tags` of root:
46
-
47
-
```sh
48
-
.
49
-
├── categories
50
-
│ ├── animal.html # a category type page
51
-
│ └── insect.html
52
-
├── tags
53
-
│ └── bee.html # a tag type page
54
-
...
55
-
```
56
-
57
-
and the content of a *category* type page is
58
-
59
-
```yaml
60
-
---
61
-
layout: category
62
-
title: CATEGORY_NAME # e.g. Insect
63
-
category: CATEGORY_NAME # e.g. Insect
64
-
---
65
-
```
66
-
67
-
the content of a *tag* type page is
68
-
69
-
```yaml
70
-
---
71
-
layout: tag
72
-
title: TAG_NAME # e.g. bee
73
-
tag: TAG_NAME # e.g. bee
74
-
---
38
+
tags: [bee]
75
39
```
76
40
77
-
With the increasing number of posts, the number of categories and tags will increase several times! If we still manually create these *category*/*tag* type files, it will obviously be a super time-consuming job, and it is very likely to miss some of them, i.e., when you click on the missing `category` or `tag` link from a post or somewhere, the browser will complain to you "404 Not Found". The good news is we got a lovely script tool `_scripts/sh/create_pages.sh` to finish the boring tasks. Basically we will use it through `run.sh`, `build.sh` or `deploy.sh` that placed in `tools/` instead of running it separately. Check out its use case [here]({{ "/posts/getting-started/#deployment" | relative_url }}).
78
-
79
-
## Last modified date
80
-
81
-
The last modified date of a post is obtained according to the post's latest git commit date, and the modified date of all posts are designed to be stored in the file `_data/updates.yml`. Then contents of that file may be as follows:
82
-
83
-
```yaml
84
-
-
85
-
filename: getting-started # the post filename without date and extension
86
-
lastmod: 2020-04-13 00:38:56 +0800 # the post last modified date
87
-
-
88
-
...
89
-
```
90
-
91
-
You can choose to create this file manually, But the better approach is to let it be automatically generated by a script tool, and `_scripts/sh/dump_lastmod.sh` was born for this! Similar to the other script (`create_pages.sh`) mentioned above, it is also be called from the other superior tools, so it doesn't have to be used separately.
92
-
93
-
When some posts have been modified since their published date and also the file `_data/updates.yml` was created correctly, a list with the label **Recent Updates** will be displayed in the right panel of the desktop view, which records the five most recently modified posts.
94
-
95
41
## Table of Contents
96
42
97
43
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the value of variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
@@ -102,7 +48,6 @@ toc: false
102
48
---
103
49
```
104
50
105
-
106
51
## Comments
107
52
108
53
Similar to TOC, the [Disqus](https://disqus.com/) comments is loaded by default in each post, and the global switch is defined by variable `comments` in file `_config.yml` . If you want to close the comment for specific post, add the following to the **Front Matter** of the post:
@@ -113,7 +58,6 @@ comments: false
113
58
---
114
59
```
115
60
116
-
117
61
## Mathematics
118
62
119
63
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:
Copy file name to clipboardExpand all lines: _posts/2019-08-09-getting-started.md
+8-28Lines changed: 8 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,32 +28,16 @@ $ bundle install
28
28
29
29
`bundle` will automatically install all the dependencies specified by `Gemfile`.
30
30
31
-
In order to generate some extra files (_categories_, _tags_ and _last modified list_), we need to use some tool scripts. And they require dependency package [yq](https://github.com/mikefarah/yq#install) to be installed. What's more, if your machine is running Debian or macOS, you also need to install [GNU coreutils](https://www.gnu.org/software/coreutils/).
32
-
33
-
- on Debian:
34
-
35
-
```console
36
-
$ sudo apt-get install coreutils
37
-
```
38
-
39
-
- on macOS:
40
-
41
-
```console
42
-
$ brew install coreutils
43
-
```
44
-
45
31
### Setting up Docker environment (optional)
46
32
47
33
If you're a loyal fan of [**Docker**](https://www.docker.com/) or just too lazy to install the packages mentioned in [_Setting up the local envrionment_](#setting-up-the-local-envrionment), please make sure you have **Docker Engine** installed and running, and then get Docker image `jekyll/jekyll` from Docker Hub by the following command:
48
34
49
35
```console
50
-
$ docker pull jekyll/jekyll:latest
36
+
$ docker pull jekyll/jekyll
51
37
```
52
38
53
39
## Usage
54
40
55
-
Running [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) requires some extra files, which cannot be generated by Jekyll native commands, so please strictly follow the methods mentioned below to run or deploy your website.
56
-
57
41
### Initialization
58
42
59
43
Go to the root directory of the project and start initialization:
@@ -90,13 +74,11 @@ Generally, go to `_config.yml` and configure the variables as needed. Some of th
90
74
You may want to preview the site contents before publishing, so just run it by:
91
75
92
76
```terminal
93
-
$ bash tools/run.sh
77
+
$ bundle exec jekyll s
94
78
```
95
79
96
80
Then open a browser and visit to <http://localhost:4000>.
97
81
98
-
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
99
-
100
82
### Run on Docker
101
83
102
84
Run the site on Docker with the following command:
@@ -105,10 +87,9 @@ Run the site on Docker with the following command:
105
87
$ docker run --rm -it \
106
88
--volume="$PWD:/srv/jekyll" \
107
89
-p 4000:4000 jekyll/jekyll \
108
-
bash tools/run.sh --docker
90
+
jekyll serve
109
91
```
110
92
111
-
Please note that on Docker containers, you'll lose the real-time refresh feature.
112
93
113
94
### Deployment
114
95
@@ -118,7 +99,7 @@ Assuming you have already gone through the [initialization](#initialization), yo
118
99
119
100
#### Deploy on GitHub Pages
120
101
121
-
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using tool scripts 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 Pages service.
102
+
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 Pages service.
122
103
123
104
1. Push any commit to `origin/master` 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.
124
105
@@ -134,18 +115,17 @@ On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Acti
134
115
Go to the root of the source project, build your site by:
135
116
136
117
```console
137
-
$ bash tools/build.sh
118
+
$ JEKYLL_ENV=production bundle exec jekyll b
138
119
```
139
120
140
-
> **Note**: The output path can be specified with the option `-d`.
141
-
142
121
Or, build the site with Docker by:
143
122
144
123
```terminal
145
-
$ docker run --rm -it \
124
+
$ docker run -it --rm \
125
+
--env JEKYLL_ENV=production \
146
126
--volume="$PWD:/srv/jekyll" \
147
127
jekyll/jekyll \
148
-
bash tools/build.sh --docker
128
+
jekyll build
149
129
```
150
130
151
131
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 your web server.
0 commit comments