Skip to content

Commit fac9dbe

Browse files
committed
Update the tutorials.
1 parent a2e569d commit fac9dbe

File tree

4 files changed

+88
-71
lines changed

4 files changed

+88
-71
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
# Chirpy
22

3-
Language: **English** | [简体中文](docs/README_zh-CN.md)
3+
🌏 English [简体中文](docs/README_zh-CN.md)
44

55
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=event%3Apush)
66
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
77
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
88

9-
A minimal, sidebar, responsive web design Jekyll theme, focusing on text presentation. Aim to help you easily record and share your knowledge.
9+
A minimal, sidebar, responsive web design Jekyll theme, focusing on text presentation, aim to help you easily record and share your knowledge. [Live Demo »](https://chirpy.cotes.info)
1010

11-
**Features**
11+
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)](https://chirpy.cotes.info)
12+
13+
## Table of Contents
14+
15+
* [Features](#features)
16+
* [Installing](#installing)
17+
* [Usage](#usage)
18+
* [Contributing](#contributing)
19+
* [Credits](#credits)
20+
* [Support](#support)
21+
* [License](#license)
22+
23+
## Features
1224

1325
* Configurable theme mode
1426
* Two-level Categories
@@ -23,25 +35,13 @@ A minimal, sidebar, responsive web design Jekyll theme, focusing on text present
2335
* GA Pageviews reporting (Advanced)
2436
* SEO and Performance Optimization
2537

26-
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)](https://chirpy.cotes.info)
27-
28-
## Table of Contents
29-
30-
* [Installing](#installing)
31-
* [Usage](#usage)
32-
* [Contributing](#contributing)
33-
* [Credits](#credits)
34-
* [Support](#support)
35-
* [License](#license)
36-
37-
3838
## Installing
3939

4040
### Prerequisites
4141

42-
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (`Ruby `, `RubyGems` and `Bundler`). In order to use the script tools to save time, we also need to install [Python](https://www.python.org/downloads/)(version 3.5 or abover) and [ruamel.yaml](https://pypi.org/project/ruamel.yaml/).
42+
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (`Ruby `, `RubyGems` and `Bundler`).
4343

44-
In addition, if your machine is running Debian or macOS, make sure the [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, get it by:
44+
To improve the writing experience, we need to use some script tools. If your machine is running Debian or macOS, make sure that [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, install by:
4545

4646
* Debian
4747

@@ -61,12 +61,12 @@ $ brew install coreutils
6161
[Fork **Chirpy** from GitHub](https://github.com/cotes2020/jekyll-theme-chirpy/fork), then clone your forked repo to local:
6262

6363
```console
64-
$ git clone git@github.com:USER/jekyll-theme-chirpy.git
64+
$ git clone git@github.com:USER/jekyll-theme-chirpy.git -b master
6565
```
6666

67-
replace the `USER` above to your GitHub username.
67+
and replace the `USER` above to your GitHub username.
6868

69-
The first time you run or build the project on your machine, perform the installation of Jekyll plugins. Go to the root of repo and run:
69+
The first time you run or build the project on local machine, perform the installation of Jekyll plugins. Go to the root of repo and run:
7070

7171
```terminal
7272
$ bundle install
@@ -115,9 +115,9 @@ As mentioned above, some files or directories should be removed from your repo:
115115
- .github
116116

117117

118-
### Customization
118+
### Configuration
119119

120-
Basically, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
120+
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
121121

122122
* `url`
123123

@@ -144,7 +144,7 @@ Basically, go to `_config.yml` and configure the variables as needed. Some of th
144144

145145
### Run Locally
146146

147-
You may want to preview the site before publishing, so just run the script tool:
147+
You may want to preview the site content before publishing, so just run the script tool:
148148

149149
```terminal
150150
$ bash tools/run.sh

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

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,36 @@ tags: [TAG] # TAG names should always be lowercase
2525

2626
> **Note**: The posts' ***layout*** has been set to `post` by default, so there is no need to add the variable ***layout*** in Front Matter block.
2727
28-
- **Timezone of date**
28+
### Timezone of date
2929

30-
In order to accurately record the release date of a post, you should not only setup the `timezone` of `_config.yml` but also provide the the post's timezone in field `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
30+
In order to accurately record the release date of a post, you should not only setup the `timezone` of `_config.yml` but also provide the the post's timezone in field `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
3131

32-
- **Categories and Tags**
32+
### 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.
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.
3535

36-
The list of posts belonging to the same category/tag is recorded on a separate page. The number of such *category*/*tag* type pages is equal to the number of `categories`/`tags` for all posts, they must match perfectly.
36+
The list of posts belonging to the same category/tag is recorded on a separate page. The number of such *category*/*tag* type pages is equal to the number of `categories`/`tags` for all posts, they must match perfectly.
3737

38-
let's say there is a post with front matter:
38+
let's say there is a post with front matter:
3939
```yaml
4040
categories: [Animal, Insect]
4141
tags: bee
4242
```
4343
44-
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:
44+
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:
45+
4546
```terminal
4647
jekyll-theme-chirpy
4748
├── categories
4849
│   ├── animal.html
49-
│   └── tutorial.html
50-
└── tags
51-
  └── bee.html
50+
│   └── insect.html
51+
├── tags
52+
│   └── bee.html
53+
...
5254
```
5355

54-
and the content of a *category* type page is
56+
and the content of a *category* type page is
57+
5558
```yaml
5659
---
5760
layout: category
@@ -60,7 +63,8 @@ category: CATEGORY_NAME # e.g. Insect
6063
---
6164
```
6265

63-
the content of a *tag* type page is
66+
the content of a *tag* type page is
67+
6468
```yaml
6569
---
6670
layout: tag
@@ -69,20 +73,23 @@ tag: TAG_NAME # e.g. bee
6973
---
7074
```
7175

72-
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, it will complain to you '404'). The good news is that we got a lovely script tool `_scripts/py/pages_generator.py` to finish the boring task. Basically we will use it via `tools/init.sh` instead of running it separately. Check out its use case [here]({{ "/posts/getting-started/#option-1-built-by-github-pages" | relative_url }}).
76+
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, it will complain to you '404'). The good news is that we got a lovely script tool `_scripts/sh/create_pages.sh` to finish the boring task. Basically we will use it via `tools/init.sh` instead of running it separately. Check out its use case [here]({{ "/posts/getting-started/#option-1-built-by-github-pages" | relative_url }}).
7377

74-
- **Last modified date**
78+
## Last modified date
7579

76-
The last modified date of the posts is recorded as `seo.date_modified`, for example:
80+
The last modified date of a post is obtained according to its latest git commit date, and all the modified date of the posts should be stored in `_data/updates.yml`. For example:
81+
7782
```yaml
78-
---
79-
seo:
80-
date_modified: 2020-01-04 17:05:41 +0800
81-
---
83+
-
84+
filename: getting-started # the post filename without date and extension
85+
lastmod: 2020-04-13 00:38:56 +0800 # the post last modified date
86+
-
87+
...
8288
```
8389

84-
This date is equal to the lastest git-commit date of the post file and can be automatically generated by the tool script `_scripts/py/update_posts_lastmod.py`. Similar to the other script `pages_generator.py` mentioned above, it is also be called from `tools/init.sh`, so it doesn't have to be used separately.
85-
90+
You can choose to create this file manually, but as you may notice, the better approach is to let it be automatically generated by a tool script. And `_scripts/sh/dump_lastmod.py` was born for this! Similar to the another script `_scripts/sh/create_pages.sh` mentioned above, it is also be called from `tools/init.sh`, so it doesn't have to be used separately.
91+
92+
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 articles.
8693

8794
## Table of Contents
8895

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ categories: [Blogging, Tutorial]
66
tags: [getting started]
77
---
88

9-
## Preparation
9+
## Prerequisites
1010

11-
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (Ruby, RubyGem, Bundler and Jekyll). In order to use the script tools to save time, we also need to install [Python](https://www.python.org/downloads/)(version 3.5 or abover) and [ruamel.yaml](https://pypi.org/project/ruamel.yaml/).
11+
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (`Ruby `, `RubyGems` and `Bundler`).
1212

13-
In addition, if your machine is running Debian or macOS, make sure you have the [GNU coreutils](https://www.gnu.org/software/coreutils/) installed. Otherwise, get it by:
13+
To improve the writing experience, we need to use some script tools. If your machine is running Debian or macOS, make sure that [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, install by:
1414

1515
* Debian
1616

@@ -25,18 +25,26 @@ $ brew install coreutils
2525
```
2626

2727

28-
## Install Jekyll Plugins
28+
## Jekyll Plugins
2929

30-
Go to the root of repo and run:
30+
[Fork **Chirpy** from GitHub](https://github.com/cotes2020/jekyll-theme-chirpy/fork), then clone your forked repo to local:
31+
32+
```console
33+
$ git clone git@github.com:USER/jekyll-theme-chirpy.git -b master
34+
```
35+
36+
and replace the `USER` above to your GitHub username.
37+
38+
The first time you run or build the project on local machine, perform the installation of Jekyll plugins. Go to the root of repo and run:
3139

3240
```terminal
3341
$ bundle install
3442
```
3543

36-
`bundle` will install all the dependent Jekyll Plugins listed in file `Gemfile` automatically.
44+
`bundle` will automatically install all the dependent Jekyll Plugins that listed in the `Gemfile`.
3745

3846

39-
## File Structure
47+
## Directory Structure
4048

4149
The main files and related brief introductions are listed below.
4250

@@ -74,7 +82,7 @@ As mentioned above, some files or directories should be removed from your repo:
7482

7583
## Configuration
7684

77-
Basically, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
85+
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
7886

7987
* `url`
8088

@@ -101,7 +109,7 @@ Basically, go to `_config.yml` and configure the variables as needed. Some of th
101109

102110
## Run Locally
103111

104-
You may want to preview the site before publishing, so just run the script tool:
112+
You may want to preview the site content before publishing, so just run the script tool:
105113

106114
```terminal
107115
$ bash tools/run.sh

docs/README_zh-CN.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
# Chirpy
22

3-
语言: [English](../README.md) | **简体中文**
3+
🌏 [English](../README.md) 简体中文
44

55
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=event%3Apush)
66
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
77
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
88

9-
一个不一样的 Jekyll 主题(内附神秘工具),采用响应式设计,方便记录、管理、分享你的知识和经验。
9+
一个不一样的响应式设计 Jekyll 主题(内附神秘工具),采用响应式设计,方便记录、管理、分享你的知识和经验。
1010

11-
**功能一览**
11+
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)](https://chirpy.cotes.info)
12+
13+
## 目录
14+
15+
* [功能预览](#功能预览)
16+
* [安装](#安装)
17+
* [运行指南](#运行指南)
18+
* [参与贡献](#参与贡献)
19+
* [感谢](#感谢)
20+
* [赞助](#赞助)
21+
* [许可证书](#许可证书)
22+
23+
## 功能预览
1224

1325
* 自动暗夜模式
1426
* 文章最后修改日期
@@ -24,24 +36,14 @@
2436
* SEO 优化
2537
* 网站性能优化
2638

27-
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)](https://chirpy.cotes.info)
28-
29-
## 目录
30-
31-
* [安装](#安装)
32-
* [运行指南](#运行指南)
33-
* [参与贡献](#参与贡献)
34-
* [感谢](#感谢)
35-
* [赞助](#赞助)
36-
* [许可证书](#许可证书)
3739

3840
## 安装
3941

4042
### 准备工作
4143

42-
按照 [Jekyll 官方文档](https://jekyllrb.com/docs/installation/) 完成基础环境的安装 (Ruby,RubyGem,Bundler 和 Jekyll)。为了使用项目内免费提供的脚本工具,你还需要安装 [Python](https://www.python.org/downloads/)( >= 3.5) 和 [ruamel.yaml](https://pypi.org/project/ruamel.yaml/)
44+
按照 [Jekyll 官方文档](https://jekyllrb.com/docs/installation/) 完成基础环境的安装 (Ruby,RubyGem,Bundler 和 Jekyll)。
4345

44-
如果你的机器系统是 Debian 或者 macOS,则需要确保安装了 [GNU coreutils](https://www.gnu.org/software/coreutils/)。否则,通过以下方式获得:
46+
为了使用项目内免费提供的脚本工具提升你的写作体验,如果你的机器系统是 Debian 或者 macOS,则需要确保安装了 [GNU coreutils](https://www.gnu.org/software/coreutils/)。否则,通过以下方式获得:
4547

4648
* Debian
4749

@@ -58,16 +60,16 @@
5860
接着,[fork](https://github.com/cotes2020/jekyll-theme-chirpy/fork) 一份代码,然后克隆你 Fork 的仓库到本地机器上。
5961

6062
```console
61-
$ git clone git@github.com:USER/jekyll-theme-chirpy.git
63+
$ git clone git@github.com:USER/jekyll-theme-chirpy.git -b master
6264
```
6365

64-
`USER` 替换为你的 GitHub username。
66+
把上述的`USER` 替换为你的 GitHub username。
6567

6668

6769

6870
### 安装 Jekyll 插件
6971

70-
在根目录下运行:
72+
本地首次运行或编译,请在项目根目录下运行:
7173

7274
```terminal
7375
$ bundle install

0 commit comments

Comments
 (0)