Improve docs

This commit is contained in:
Cotes Chung 2021-02-02 04:23:53 +08:00
parent 7d3e25c90d
commit fa56ea48c3
3 changed files with 43 additions and 43 deletions

View file

@ -2,10 +2,10 @@
Language: English | [简体中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)](https://rubygems.org/gems/jekyll-theme-chirpy)
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?branch=master&event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8220b926db514f13afc3f02b7f884f4b)](https://app.codacy.com/manual/cotes2020/jekyll-theme-chirpy?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade_Dashboard)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=important)](https://rubygems.org/gems/jekyll-theme-chirpy)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg?color=blue)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation. Designed to help you record and share your knowledge easily. [Live Demo »](https://chirpy.cotes.info)
@ -50,10 +50,10 @@ Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete th
There are two ways to get the theme:
- Install from [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy)
- Fork from GitHub
- **Install from RubyGems** - Easy to upgrade, isolate irrelevant project files so you can focus on writing.
- **Fork from GitHub** - Convenient for custom development, but difficult to upgrade, only suitable for web developers.
### Install From Rubygems
### Install From RubyGems
Add this line to your Jekyll site's `Gemfile`:
@ -73,15 +73,15 @@ And then execute:
$ bundle
```
Finally, copy the extra files (refer to the [starter project][starter] for the detailed file directory structure) from the theme's gem to your Jekyll site, and append all the variables of the theme's `_config.yml` to your Jekyll site.
Finally, copy the required files from the theme's gem (for detailed files, see [starter project][starter]) to your Jekyll site.
> **Hint**: To locate the themes gem, execute:
> **Hint**: To locate the installed themes gem, execute:
>
```console
$ bundle info --path jekyll-theme-chirpy
```
Or you can [use the starter template][use-starter] to create a Jekyll site to save time copying contents from theme's gem.
Or you can [**use the starter template**][use-starter] to create a Jekyll site to save time copying files from theme's gem. We have prepared everything for you there!
### Fork From GitHub
@ -121,7 +121,7 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
- `url`
- `avatar`
- `timezone`
- `theme_mode`
- `lang`
### Running Local Server
@ -154,12 +154,12 @@ For security reasons, GitHub Pages build runs on `safe` mode, which restricts us
Quickly check the files needed for GitHub Actions build:
1. Ensure your Jekyll site has the file `/.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [workflow file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
2. Ensuer your Jekyll site has file `/tools/test.sh` and `/tools/deploy.sh`. Otherwise, copy them from this repo to your Jekyll site.
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [workflow file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
- Ensuer your Jekyll site has file `tools/test.sh` and `tools/deploy.sh`. Otherwise, copy them from this repo to your Jekyll site.
Next, rename your repoistory to `<GH-USERNAME>.github.io` on GitHub.
And then rename your repoistory to `<GH-USERNAME>.github.io` on GitHub.
And then publish your Jekyll site by:
Now publish your Jekyll site by:
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.

View file

@ -15,10 +15,10 @@ Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete th
There are two ways to get the theme:
- Install from [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy)
- Fork from GitHub
- **Install from RubyGems** - Easy to upgrade, isolate irrelevant project files so you can focus on writing.
- **Fork from GitHub** - Convenient for custom development, but difficult to upgrade, only suitable for web developers.
### Install From Rubygems
### Install From RubyGems
Add this line to your Jekyll site's `Gemfile`:
@ -38,15 +38,15 @@ And then execute:
$ bundle
```
Finally, copy the extra files (refer to the [starter project][starter] for the detailed file directory structure) from the theme's gem to your Jekyll site, and append all the variables of the theme's `_config.yml` to your Jekyll site.
Finally, copy the required files from the theme's gem (for detailed files, see [starter project][starter]) to your Jekyll site.
> **Hint**: To locate the themes gem, execute:
> **Hint**: To locate the installed themes gem, execute:
>
```console
$ bundle info --path jekyll-theme-chirpy
```
Or you can [use the starter template][use-starter] to create a Jekyll site to save time copying contents from theme's gem.
Or you can [**use the starter template**][use-starter] to create a Jekyll site to save time copying files from theme's gem. We have prepared everything for you there!
### Fork From GitHub
@ -86,7 +86,7 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
- `url`
- `avatar`
- `timezone`
- `theme_mode`
- `lang`
### Running Local Server
@ -119,12 +119,12 @@ For security reasons, GitHub Pages build runs on `safe` mode, which restricts us
Quickly check the files needed for GitHub Actions build:
1. Ensure your Jekyll site has the file `/.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [workflow file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
2. Ensuer your Jekyll site has file `/tools/test.sh` and `/tools/deploy.sh`. Otherwise, copy them from this repo to your Jekyll site.
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [workflow file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
- Ensuer your Jekyll site has file `tools/test.sh` and `tools/deploy.sh`. Otherwise, copy them from this repo to your Jekyll site.
Next, rename your repoistory to `<GH-USERNAME>.github.io` on GitHub.
And then rename your repoistory to `<GH-USERNAME>.github.io` on GitHub.
And then publish your Jekyll site by:
Now publish your Jekyll site by:
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.

View file

@ -2,13 +2,13 @@
Language: [English](https://github.com/cotes2020/jekyll-theme-chirpy#readme) | 简体中文
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)](https://rubygems.org/gems/jekyll-theme-chirpy)
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?branch=master&event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8220b926db514f13afc3f02b7f884f4b)](https://app.codacy.com/manual/cotes2020/jekyll-theme-chirpy?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade_Dashboard)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=important)](https://rubygems.org/gems/jekyll-theme-chirpy)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg?color=blue)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
一个不一样的 Jekyll 主题,采用响应式设计,方便记录、管理、分享的知识和经验。[懂的进 »](https://chirpy.cotes.info)
一个不一样的 Jekyll 主题,采用响应式设计,方便记录、管理、分享的知识和经验。[懂的进 »](https://chirpy.cotes.info)
[![Devices Mockup](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png)](https://chirpy.cotes.info)
@ -55,18 +55,18 @@ Language: [English](https://github.com/cotes2020/jekyll-theme-chirpy#readme) |
有二法可得此主题:
- 从 [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy) 安装
- 从 GitHub 上 Fork
- **从 RubyGems 安装** - 易于版本升级,隔离无关的主题项目文件,让您的仓库舒适清爽。
- **从 GitHub 上 Fork** - 对个性化二次开发友好,但是难于升级,只适合专业开发人员使用。
### Rubygems 安装
### RubyGems 安装
的 Jekyll 站点的 `Gemfile` 添加:
的 Jekyll 站点的 `Gemfile` 添加:
```ruby
gem "jekyll-theme-chirpy"
```
然后,添加这行到的 Jekyll 站点的 `_config.yml`:
然后,添加这行到的 Jekyll 站点的 `_config.yml`:
```yaml
theme: jekyll-theme-chirpy
@ -78,7 +78,7 @@ theme: jekyll-theme-chirpy
$ bundle
```
最后, 拷贝额外所需主题的 gem 文件(详见 [starter 项目][starter] 的文件目录)至你的 Jekyll 站点, 然后把主题的 `_config.yml` 全部内容附加到你的 Jekyll 站点的同名文件。
最后, 拷贝额外所需主题的 gem 文件(详见 [starter 项目][starter] 的文件目录)至您的 Jekyll 站点, 然后把主题的 `_config.yml` 全部内容附加到您的 Jekyll 站点的同名文件。
> **提示**: 定位主题的 gem 文件,可以执行:
>
@ -86,7 +86,7 @@ $ bundle
$ bundle info --path jekyll-theme-chirpy
```
或者可以 [使用 starter template][use-starter] 来快速创建 Jekyll 站点,以省去复制主题 gem 文件的时间。
或者可以 [使用 starter template][use-starter] 来快速创建 Jekyll 站点,以省去复制主题 gem 文件的时间。
### 在 GitHub 上 Fork
@ -104,11 +104,11 @@ $ bundle
$ bash tools/init.sh
```
> 如果不打算部署到 GitHub Pages, 在上述命令后附加参数选项 `--no-gh`
> 如果不打算部署到 GitHub Pages, 在上述命令后附加参数选项 `--no-gh`
上述脚本完成了以下工作:
1. 从的仓库中删除了:
1. 从的仓库中删除了:
- `.travis.yml`
- `_posts` 下的文件
- `docs` 目录
@ -126,7 +126,7 @@ $ bash tools/init.sh
- `url`
- `avatar`
- `timezone`
- `theme_mode`
- `lang`
### 本地运行
@ -149,9 +149,9 @@ $ docker run -it --rm \
### 部署
部署开始前,把 `_config.yml``url` 改为 `https://<username>.github.io`(或者你的私有域名,如:`https://yourdomain.com`)。另外,如果你想使用 [Project 类型网站](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites),修改配置文件的 `baseurl` 为项目名称,以斜杠开头,如:`/project`。
部署开始前,把 `_config.yml``url` 改为 `https://<username>.github.io`(或者您的私有域名,如:`https://yourdomain.com`)。另外,如果您想使用 [Project 类型网站](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites),修改配置文件的 `baseurl` 为项目名称,以斜杠开头,如:`/project`。
现在可以选择下列其中一个方式去站点部署。
现在可以选择下列其中一个方式去站点部署。
#### 部署到 GitHub Pages
@ -159,10 +159,10 @@ $ docker run -it --rm \
快速检查 GitHub Actions 构建需要的文件:
1. 确保你的 Jekyll 站点存在文件 `/.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和的仓库默认分支名相同。
2. 检查你的 Jekyll 站点是否有文件 `/tools/test.sh``/tools/deploy.sh`. 没有的话, 从本仓库拷贝到你的 Jekyll 项目.
- 确保您的 Jekyll 站点存在文件 `.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和的仓库默认分支名相同。
- 检查您的 Jekyll 站点是否有文件 `tools/test.sh``tools/deploy.sh`. 没有的话, 从本仓库拷贝到您的 Jekyll 项目.
在 GitHub 把的仓库命名为 `<GH-USERNAME>.github.io`,然后:
在 GitHub 把的仓库命名为 `<GH-USERNAME>.github.io`,然后开始发布
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
@ -170,7 +170,7 @@ $ docker run -it --rm \
![gh-pages-sources](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190809/gh-pages-sources.png)
3. 按照 GitHub 指示的地址去访问的网站。
3. 按照 GitHub 指示的地址去访问的网站。
#### 部署到其他 Pages 平台