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
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)
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`).
43
43
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:
45
45
46
46
* Debian
47
47
@@ -61,12 +61,12 @@ $ brew install coreutils
61
61
[Fork **Chirpy** from GitHub](https://github.com/cotes2020/jekyll-theme-chirpy/fork), then clone your forked repo to local:
Copy file name to clipboardExpand all lines: _posts/2019-08-08-write-a-new-post.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,33 +25,36 @@ tags: [TAG] # TAG names should always be lowercase
25
25
26
26
> **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.
27
27
28
-
-**Timezone of date**
28
+
### Timezone of date
29
29
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`.
31
31
32
-
-**Categories and Tags**
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.
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
35
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.
37
37
38
-
let's say there is a post with front matter:
38
+
let's say there is a post with front matter:
39
39
```yaml
40
40
categories: [Animal, Insect]
41
41
tags: bee
42
42
```
43
43
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
+
45
46
```terminal
46
47
jekyll-theme-chirpy
47
48
├── categories
48
49
│ ├── animal.html
49
-
│ └── tutorial.html
50
-
└── tags
51
-
└── bee.html
50
+
│ └── insect.html
51
+
├── tags
52
+
│ └── bee.html
53
+
...
52
54
```
53
55
54
-
and the content of a *category* type page is
56
+
and the content of a *category* type page is
57
+
55
58
```yaml
56
59
---
57
60
layout: category
@@ -60,7 +63,8 @@ category: CATEGORY_NAME # e.g. Insect
60
63
---
61
64
```
62
65
63
-
the content of a *tag* type page is
66
+
the content of a *tag* type page is
67
+
64
68
```yaml
65
69
---
66
70
layout: tag
@@ -69,20 +73,23 @@ tag: TAG_NAME # e.g. bee
69
73
---
70
74
```
71
75
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 }}).
73
77
74
-
- **Last modified date**
78
+
## Last modified date
75
79
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
+
77
82
```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
+
...
82
88
```
83
89
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.
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`).
12
12
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:
14
14
15
15
* Debian
16
16
@@ -25,18 +25,26 @@ $ brew install coreutils
25
25
```
26
26
27
27
28
-
## Install Jekyll Plugins
28
+
## Jekyll Plugins
29
29
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:
0 commit comments