Merge branch 'feature/docs'

This commit is contained in:
Cotes Chung 2022-01-19 01:27:33 +08:00
commit 0890147423
4 changed files with 37 additions and 28 deletions

View File

@ -1,32 +1,40 @@
os: linux
dist: bionic
language: ruby
rvm: 2.7.0
language: minimal
before_script: git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
# only run on tags
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
addons:
apt:
packages:
- libcurl4-openssl-dev # to avoid SSL error (for htmlproofer)
# Overriding to drop the `--development` flag which requires the Gemfile.lock at build
install: bundle install --jobs=3 --retry=3 --path=vendor/bundle
jobs:
include:
- name: Deploy
language: ruby
rvm: 2.7.0
addons:
apt:
packages:
- libcurl4-openssl-dev # to avoid SSL error (for htmlproofer)
install:
- bundle install --jobs=3 --retry=3 # overriding to drop the travis `--development` flag
script:
- eval "$BUILD_CMD"
- stage: Deploy
git:
depth: false # for posts' lastmod
- name: Flush Starter
script: eval "$BUILD_CMD"
- stage: Flush Starter
install: true # skip install step
script: eval "$FLUSH_STARTER"
- stage: Update Docs
cache: bundler
git:
depth: false # for posts' lastmod
script: eval "$DOCS_CMD"
before_script:
- git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
stages:
- name: Deploy
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
- name: Flush Starter
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
- name: Update Docs
if: branch = docs
notifications:
email:

View File

@ -38,7 +38,7 @@
## Quick Start
Before starting, please follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
Before starting, please follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`. In addition, [Git](https://git-scm.com/) is also required to be installed.
### Step 1. Creating a New Site

View File

@ -217,7 +217,6 @@ The output will be:
```
{: .nolineno }
### Preview Image
If you want to add an image to the top of the post contents, specify the attribute `src`, `width`, `height`, and `alt` for the image:
@ -250,9 +249,11 @@ pin: true
Markdown symbols ```` ``` ```` can easily create a code block as follows:
````md
```
This is a plaintext code snippet.
```
````
### Specifying Language
@ -268,18 +269,18 @@ key: value
### Line Number
By default, all languages except `plaintext`, `console`, and `terminal` will display line numbers. When you want to hide the line number of the code block, you can append `{: .nolineno}` at the next line:
By default, all languages except `plaintext`, `console`, and `terminal` will display line numbers. When you want to hide the line number of a code block, add the class `nolineno` to it:
````markdown
```shell
echo 'No more line numbers!'
```
{: .nolineno}
{: .nolineno }
````
### Specifying the Filename
You may have noticed that the code language will be displayed on the left side of the header of the code block. If you want to replace it with the file name, you can add the attribute `file` to achieve this:
You may have noticed that the code language will be displayed at the top of the code block. If you want to replace it with the file name, you can add the attribute `file` to achieve this:
````markdown
```shell

View File

@ -11,7 +11,7 @@ pin: true
## Prerequisites
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`. In addition, [Git](https://git-scm.com/) is also required to be installed.
## Installation
@ -95,13 +95,13 @@ $ docker run -it --rm \
After a while, the local service will be published at _<http://127.0.0.1:4000>_.
### Deployment
## Deployment
Before the deployment begins, check out 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 starts with a slash, e.g, `/project-name`.
Now you can choose ONE of the following methods to deploy your Jekyll site.
#### Deploy by Using Github Actions
### Deploy by Using Github Actions
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 GitHub Pages service.
@ -129,7 +129,7 @@ Now publish your Jekyll site by:
3. Visit your website at the address indicated by GitHub.
#### Manually Build and Deploy
### Manually Build and Deploy
On self-hosted servers, you cannot enjoy the convenience of **GitHub Actions**. Therefore, you should build the site on your local machine and then upload the site files to the server.
@ -151,7 +151,7 @@ $ docker run -it --rm \
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 the target server.
### Upgrading
## Upgrading
It depends on how you use the theme: