Skip to content

Commit 2c48822

Browse files
committed
Update the docs for discarded tools
1 parent b0ffd26 commit 2c48822

6 files changed

Lines changed: 52 additions & 138 deletions

File tree

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ labels: question
1515
- [ ] I searched the Internet for related problems, but still couldn't solve it.
1616
- [ ] My question is based on the latest code of `master` branch.
1717

18-
1918
## Description
20-
<!-- Please describe your question. -->
19+
<!-- Please describe your question in detial. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Please select the desired item checkbox and change it to "[x]", then delete opti
2222
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
2323
-->
2424

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
2626
- [ ] I have tested this feature in the browser
2727

2828
### Test Configuration
@@ -41,4 +41,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi
4141
- [ ] I have made corresponding changes to the documentation
4242
- [ ] My changes generate no new warnings
4343
- [ ] 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

README.md

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,16 @@ $ bundle install
5858

5959
`bundle` will automatically install all the dependencies specified by `Gemfile`.
6060

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-
7561
### Setting up Docker environment (optional)
7662

7763
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:
7864

7965
```console
80-
$ docker pull jekyll/jekyll:latest
66+
$ docker pull jekyll/jekyll
8167
```
8268

8369
## Usage
8470

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-
8771
### Initialization
8872

8973
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
120104
You may want to preview the site contents before publishing, so just run it by:
121105

122106
```terminal
123-
$ bash tools/run.sh
107+
$ bundle exec jekyll s
124108
```
125109

126110
Then open a browser and visit to <http://localhost:4000>.
127111

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-
130112
### Run on Docker
131113

132114
Run the site on Docker with the following command:
133115

134116
```terminal
135-
$ docker run --rm -it \
117+
$ docker run -it --rm \
136118
--volume="$PWD:/srv/jekyll" \
137119
-p 4000:4000 jekyll/jekyll \
138-
bash tools/run.sh --docker
120+
jekyll serve
139121
```
140122

141-
Please note that on Docker containers, you'll lose the real-time refresh feature.
142-
143123
### Deployment
144124

145125
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
148128

149129
#### Deploy on GitHub Pages
150130

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.
152132

153133
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.
154134

@@ -164,18 +144,17 @@ On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Acti
164144
Go to the root of the source project, build your site by:
165145

166146
```console
167-
$ bash tools/build.sh
147+
$ JEKYLL_ENV=production bundle exec jekyll b
168148
```
169149

170-
> **Note**: The output path can be specified with the option `-d`.
171-
172150
Or, build the site with Docker by:
173151

174152
```terminal
175-
$ docker run --rm -it \
153+
$ docker run -it --rm \
154+
--env JEKYLL_ENV=production \
176155
--volume="$PWD:/srv/jekyll" \
177156
jekyll/jekyll \
178-
bash tools/build.sh --docker
157+
jekyll build
179158
```
180159

181160
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.

_posts/2019-08-08-write-a-new-post.md

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -31,67 +31,13 @@ In order to accurately record the release date of a post, you should not only se
3131

3232
### Categories and Tags
3333

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:
3935

4036
```yaml
4137
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]
7539
```
7640
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-
9541
## Table of Contents
9642
9743
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
10248
---
10349
```
10450

105-
10651
## Comments
10752

10853
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
11358
---
11459
```
11560

116-
11761
## Mathematics
11862

11963
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:

_posts/2019-08-09-getting-started.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,16 @@ $ bundle install
2828

2929
`bundle` will automatically install all the dependencies specified by `Gemfile`.
3030

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-
4531
### Setting up Docker environment (optional)
4632

4733
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:
4834

4935
```console
50-
$ docker pull jekyll/jekyll:latest
36+
$ docker pull jekyll/jekyll
5137
```
5238

5339
## Usage
5440

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-
5741
### Initialization
5842

5943
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
9074
You may want to preview the site contents before publishing, so just run it by:
9175

9276
```terminal
93-
$ bash tools/run.sh
77+
$ bundle exec jekyll s
9478
```
9579

9680
Then open a browser and visit to <http://localhost:4000>.
9781

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-
10082
### Run on Docker
10183

10284
Run the site on Docker with the following command:
@@ -105,10 +87,9 @@ Run the site on Docker with the following command:
10587
$ docker run --rm -it \
10688
--volume="$PWD:/srv/jekyll" \
10789
-p 4000:4000 jekyll/jekyll \
108-
bash tools/run.sh --docker
90+
jekyll serve
10991
```
11092

111-
Please note that on Docker containers, you'll lose the real-time refresh feature.
11293

11394
### Deployment
11495

@@ -118,7 +99,7 @@ Assuming you have already gone through the [initialization](#initialization), yo
11899

119100
#### Deploy on GitHub Pages
120101

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.
122103

123104
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.
124105

@@ -134,18 +115,17 @@ On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Acti
134115
Go to the root of the source project, build your site by:
135116

136117
```console
137-
$ bash tools/build.sh
118+
$ JEKYLL_ENV=production bundle exec jekyll b
138119
```
139120

140-
> **Note**: The output path can be specified with the option `-d`.
141-
142121
Or, build the site with Docker by:
143122

144123
```terminal
145-
$ docker run --rm -it \
124+
$ docker run -it --rm \
125+
--env JEKYLL_ENV=production \
146126
--volume="$PWD:/srv/jekyll" \
147127
jekyll/jekyll \
148-
bash tools/build.sh --docker
128+
jekyll build
149129
```
150130

151131
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.

docs/README_zh-CN.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,17 @@ $ bundle install
6161

6262
`bundle` 会自动安装 `Gemfile` 内指定的依赖插件。
6363

64-
为了生成一些额外的文件(Post 的 _分类__标签_ 以及 _更新时间列表_),需要用到一些脚本工具。而它们需要安装依赖包 [yq](https://github.com/mikefarah/yq#install)。另外,如果你电脑的操作系统是 Debian 或者 macOS,还需安装 [GNU coreutils](https://www.gnu.org/software/coreutils/)
64+
### 配置 Docker 镜像(可选)
6565

66-
- Debian
66+
如果你是 [**Docker**](https://www.docker.com/) 的铁粉,或者不想在本地安装上述 [_设置本地环境_](#设置本地环境) 提到的包, 那么请确保先安装并运行了 **Docker Engine** 然后从 Docker Hub 获取镜像 `jekyll/jekyll`:
6767

68-
```console
69-
$ sudo apt-get install coreutils
70-
```
71-
72-
- macOS
68+
```console
69+
$ docker pull jekyll/jekyll
70+
```
7371

74-
```console
75-
$ brew install coreutils
76-
```
7772

7873
## 使用
7974

80-
运行 [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) 需要一些额外的文件, 它们不能通过 Jekyll 原生的命令生成,所以请严格依照下列说明去运行或部署此项目。
81-
8275
### 初始化
8376

8477
在项目根目录,开始初始化:
@@ -112,15 +105,24 @@ $ bash tools/init.sh
112105

113106
### 本地运行
114107

115-
使用以下工具可轻松运行:
108+
发布之前,在本地预览:
116109

117110
```terminal
118-
$ bash tools/run.sh
111+
$ bundle exec jekyll s
119112
```
120113

121114
访问本地服务: <http://localhost:4000>
122115

123-
如果你想在本地服务运行后,把修改源文件的更改实时刷新,可使用选项 `-r` (或 `--realtime`),不过要先安装依赖 [**fswatch**](http://emcrisostomo.github.io/fswatch/)
116+
### 用 Docker 运行
117+
118+
在项目根目录运行命令:
119+
120+
```terminal
121+
$ docker run -it --rm \
122+
--volume="$PWD:/srv/jekyll" \
123+
-p 4000:4000 jekyll/jekyll \
124+
jekyll serve
125+
```
124126

125127
### 部署
126128

@@ -130,7 +132,7 @@ $ bash tools/run.sh
130132

131133
#### 部署到 GitHub Pages
132134

133-
由于安全原因,GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用脚本工具去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
135+
由于安全原因,GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用插件去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
134136

135137
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
136138

@@ -147,10 +149,20 @@ $ bash tools/run.sh
147149
在项目根目录,运行:
148150

149151
```console
150-
$ bash tools/build.sh -d /path/to/site/
152+
$ JEKYLL_ENV=production bundle exec jekyll b
153+
```
154+
155+
或者通过 Docker 构建:
156+
157+
```terminal
158+
$ docker run -it --rm \
159+
--env JEKYLL_ENV=production \
160+
--volume="$PWD:/srv/jekyll" \
161+
jekyll/jekyll \
162+
jekyll build
151163
```
152164

153-
生成的静态文件将会在 `/path/to/site/`, 把内部的文件上传到服务器即可。
165+
生成的静态文件将会在 `_site`, 把内部的文件上传到服务器即可。
154166

155167
### 文档
156168

0 commit comments

Comments
 (0)