mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-21 07:03:44 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7443aad5d | ||
|
|
b2beaa0f4c | ||
|
|
83a7878043 | ||
|
|
94b99350fc | ||
|
|
6dc9cdfa25 | ||
|
|
fa56ea48c3 | ||
|
|
7d3e25c90d | ||
|
|
6c9ab6e5f8 | ||
|
|
91da99282d | ||
|
|
413a86277b | ||
|
|
1879b94f3d | ||
|
|
7b5f7086b7 | ||
|
|
a8b8a379f6 | ||
|
|
eacad65cbb |
14
.travis.yml
14
.travis.yml
@@ -4,7 +4,17 @@ dist: bionic
|
|||||||
language: ruby
|
language: ruby
|
||||||
rvm: 2.7.0
|
rvm: 2.7.0
|
||||||
|
|
||||||
cache: bundler
|
cache:
|
||||||
|
directories:
|
||||||
|
- $TRAVIS_BUILD_DIR/vendor/bundle
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- gem install bundler:2.2.4 # match the Gemfile.lock, travis' bundle is 2.1.2
|
||||||
|
- bundle config path 'vendor/bundle'
|
||||||
|
|
||||||
|
install:
|
||||||
|
# overriding to drop the travis `--development` flag
|
||||||
|
- bundle install --jobs=3 --retry=3
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -16,7 +26,7 @@ script:
|
|||||||
- eval "$BUILD_CMD"
|
- eval "$BUILD_CMD"
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only: production
|
only: /.*-stable$/
|
||||||
|
|
||||||
git:
|
git:
|
||||||
depth: false # for posts lastmod
|
depth: false # for posts lastmod
|
||||||
|
|||||||
9
404.html
9
404.html
@@ -6,9 +6,6 @@ permalink: /404.html
|
|||||||
redirect_from:
|
redirect_from:
|
||||||
- /norobots/
|
- /norobots/
|
||||||
- /assets/
|
- /assets/
|
||||||
- /tabs/
|
|
||||||
- /categories/
|
|
||||||
- /tags/
|
|
||||||
- /posts/
|
- /posts/
|
||||||
|
|
||||||
dynamic_title: true
|
dynamic_title: true
|
||||||
@@ -16,5 +13,9 @@ dynamic_title: true
|
|||||||
|
|
||||||
<div class="lead">
|
<div class="lead">
|
||||||
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
|
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
|
||||||
<p><a href="{{ site.baseurl }}/">Head back Home</a> to try finding it again, or search for it on the <a href="{{ site.baseurl }}/tabs/archives">Archives page</a>.</p>
|
<p>
|
||||||
|
<a href="{{ '/' | relative_url }}">Head back Home</a>
|
||||||
|
to try finding it again, or search for it on the
|
||||||
|
<a href="{{ 'archives' | relative_url }}">Archives page</a>.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
13
Gemfile
13
Gemfile
@@ -1,15 +1,8 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "jekyll", "~> 4.1"
|
gemspec
|
||||||
|
|
||||||
# plugins
|
|
||||||
group :jekyll_plugins do
|
|
||||||
gem "jekyll-paginate", "~> 1.1"
|
|
||||||
gem "jekyll-redirect-from", "~> 0.16"
|
|
||||||
gem "jekyll-seo-tag", "~> 2.7"
|
|
||||||
gem "jekyll-archives", "~> 2.2"
|
|
||||||
gem "jekyll-sitemap", "~> 1.4"
|
|
||||||
end
|
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem "html-proofer", "~> 3.18"
|
gem "html-proofer", "~> 3.18"
|
||||||
|
|||||||
32
Gemfile.lock
32
Gemfile.lock
@@ -1,10 +1,21 @@
|
|||||||
|
PATH
|
||||||
|
remote: .
|
||||||
|
specs:
|
||||||
|
jekyll-theme-chirpy (3.0.3)
|
||||||
|
jekyll (~> 4.1)
|
||||||
|
jekyll-archives (~> 2.2)
|
||||||
|
jekyll-paginate (~> 1.1)
|
||||||
|
jekyll-redirect-from (~> 0.16)
|
||||||
|
jekyll-seo-tag (~> 2.7)
|
||||||
|
jekyll-sitemap (~> 1.4)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
addressable (2.7.0)
|
addressable (2.7.0)
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
colorator (1.1.0)
|
colorator (1.1.0)
|
||||||
concurrent-ruby (1.1.7)
|
concurrent-ruby (1.1.8)
|
||||||
em-websocket (0.5.2)
|
em-websocket (0.5.2)
|
||||||
eventmachine (>= 0.12.9)
|
eventmachine (>= 0.12.9)
|
||||||
http_parser.rb (~> 0.6.0)
|
http_parser.rb (~> 0.6.0)
|
||||||
@@ -22,7 +33,7 @@ GEM
|
|||||||
typhoeus (~> 1.3)
|
typhoeus (~> 1.3)
|
||||||
yell (~> 2.0)
|
yell (~> 2.0)
|
||||||
http_parser.rb (0.6.0)
|
http_parser.rb (0.6.0)
|
||||||
i18n (1.8.5)
|
i18n (1.8.7)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jekyll (4.2.0)
|
jekyll (4.2.0)
|
||||||
addressable (~> 2.4)
|
addressable (~> 2.4)
|
||||||
@@ -57,13 +68,11 @@ GEM
|
|||||||
kramdown-parser-gfm (1.1.0)
|
kramdown-parser-gfm (1.1.0)
|
||||||
kramdown (~> 2.0)
|
kramdown (~> 2.0)
|
||||||
liquid (4.0.3)
|
liquid (4.0.3)
|
||||||
listen (3.3.3)
|
listen (3.4.1)
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
rb-inotify (~> 0.9, >= 0.9.10)
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
mercenary (0.4.0)
|
mercenary (0.4.0)
|
||||||
mini_portile2 (2.5.0)
|
nokogiri (1.11.1-x86_64-darwin)
|
||||||
nokogiri (1.11.1)
|
|
||||||
mini_portile2 (~> 2.5.0)
|
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogumbo (2.0.4)
|
nokogumbo (2.0.4)
|
||||||
nokogiri (~> 1.8, >= 1.8.4)
|
nokogiri (~> 1.8, >= 1.8.4)
|
||||||
@@ -88,23 +97,18 @@ GEM
|
|||||||
ethon (>= 0.9.0)
|
ethon (>= 0.9.0)
|
||||||
tzinfo (1.2.9)
|
tzinfo (1.2.9)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo-data (1.2020.6)
|
tzinfo-data (1.2021.1)
|
||||||
tzinfo (>= 1.0.0)
|
tzinfo (>= 1.0.0)
|
||||||
unicode-display_width (1.7.0)
|
unicode-display_width (1.7.0)
|
||||||
wdm (0.1.1)
|
wdm (0.1.1)
|
||||||
yell (2.2.2)
|
yell (2.2.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
x86_64-darwin-20
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
html-proofer (~> 3.18)
|
html-proofer (~> 3.18)
|
||||||
jekyll (~> 4.1)
|
jekyll-theme-chirpy!
|
||||||
jekyll-archives (~> 2.2)
|
|
||||||
jekyll-paginate (~> 1.1)
|
|
||||||
jekyll-redirect-from (~> 0.16)
|
|
||||||
jekyll-seo-tag (~> 2.7)
|
|
||||||
jekyll-sitemap (~> 1.4)
|
|
||||||
tzinfo (~> 1.2)
|
tzinfo (~> 1.2)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
wdm (~> 0.1.1)
|
wdm (~> 0.1.1)
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
Language: English | [简体中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
Language: English | [简体中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
||||||
|
|
||||||
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
[](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)
|
[](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)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[](https://996.icu)
|
[](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)
|
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)
|
||||||
@@ -49,10 +50,10 @@ Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete th
|
|||||||
|
|
||||||
There are two ways to get the theme:
|
There are two ways to get the theme:
|
||||||
|
|
||||||
- Install from [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy)
|
- **Install from RubyGems** - Easy to upgrade, isolate irrelevant project files so you can focus on writing.
|
||||||
- Fork from GitHub
|
- **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`:
|
Add this line to your Jekyll site's `Gemfile`:
|
||||||
|
|
||||||
@@ -72,15 +73,15 @@ And then execute:
|
|||||||
$ bundle
|
$ 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 theme’s gem, execute:
|
> **Hint**: To locate the installed theme’s gem, execute:
|
||||||
>
|
>
|
||||||
```console
|
```console
|
||||||
$ bundle info --path jekyll-theme-chirpy
|
$ 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
|
### Fork From GitHub
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
|
|||||||
- `url`
|
- `url`
|
||||||
- `avatar`
|
- `avatar`
|
||||||
- `timezone`
|
- `timezone`
|
||||||
- `theme_mode`
|
- `lang`
|
||||||
|
|
||||||
### Running Local Server
|
### Running Local Server
|
||||||
|
|
||||||
@@ -153,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:
|
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.
|
- 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.
|
- 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.
|
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.
|
||||||
|
|
||||||
@@ -218,5 +219,6 @@ This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chi
|
|||||||
|
|
||||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||||
[workflow]:https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
[jb]:https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||||
|
|
||||||
|
|||||||
76
_config.yml
76
_config.yml
@@ -1,5 +1,18 @@
|
|||||||
# The Site Configuration
|
# The Site Configuration
|
||||||
|
|
||||||
|
# Import the theme
|
||||||
|
theme: jekyll-theme-chirpy
|
||||||
|
|
||||||
|
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
|
||||||
|
# change below value to '/projectname'.
|
||||||
|
baseurl: ''
|
||||||
|
|
||||||
|
# the HTML language tag › https://www.w3.org/International/questions/qa-choosing-language-tags
|
||||||
|
lang: en-US
|
||||||
|
|
||||||
|
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
||||||
|
timezone: Asia/Shanghai
|
||||||
|
|
||||||
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
||||||
# --------------------------
|
# --------------------------
|
||||||
title: Chirpy # the main title
|
title: Chirpy # the main title
|
||||||
@@ -36,14 +49,6 @@ social:
|
|||||||
google_site_verification: google_meta_tag_verification # change to your verification string
|
google_site_verification: google_meta_tag_verification # change to your verification string
|
||||||
# --------------------------
|
# --------------------------
|
||||||
|
|
||||||
|
|
||||||
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
|
|
||||||
# change below value to '/projectname'.
|
|
||||||
baseurl: ''
|
|
||||||
|
|
||||||
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
|
||||||
timezone: Asia/Shanghai
|
|
||||||
|
|
||||||
google_analytics:
|
google_analytics:
|
||||||
id: '' # Fill with your Google Analytics ID
|
id: '' # Fill with your Google Analytics ID
|
||||||
pv:
|
pv:
|
||||||
@@ -55,11 +60,6 @@ google_analytics:
|
|||||||
proxy_endpoint: ''
|
proxy_endpoint: ''
|
||||||
cache: false # pv data local cache, good for the users from GFW area.
|
cache: false # pv data local cache, good for the users from GFW area.
|
||||||
|
|
||||||
disqus:
|
|
||||||
comments: false # boolean type, the global switch for posts comments.
|
|
||||||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
|
||||||
|
|
||||||
|
|
||||||
# Prefer color scheme setting.
|
# Prefer color scheme setting.
|
||||||
#
|
#
|
||||||
# Note: Keep empty will follow the system prefer color by default,
|
# Note: Keep empty will follow the system prefer color by default,
|
||||||
@@ -69,7 +69,6 @@ disqus:
|
|||||||
# Available options:
|
# Available options:
|
||||||
#
|
#
|
||||||
# light - Use the light color scheme
|
# light - Use the light color scheme
|
||||||
#
|
|
||||||
# dark - Use the dark color scheme
|
# dark - Use the dark color scheme
|
||||||
#
|
#
|
||||||
theme_mode: # [light|dark]
|
theme_mode: # [light|dark]
|
||||||
@@ -87,8 +86,14 @@ avatar: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/avatar.jpg
|
|||||||
# boolean type, the global switch for ToC in posts.
|
# boolean type, the global switch for ToC in posts.
|
||||||
toc: true
|
toc: true
|
||||||
|
|
||||||
|
disqus:
|
||||||
|
comments: false # boolean type, the global switch for posts comments.
|
||||||
|
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||||
|
|
||||||
paginate: 10
|
paginate: 10
|
||||||
|
|
||||||
|
# ------------ The following options are not recommended to be modified ------------------
|
||||||
|
|
||||||
kramdown:
|
kramdown:
|
||||||
syntax_highlighter: rouge
|
syntax_highlighter: rouge
|
||||||
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
||||||
@@ -101,7 +106,7 @@ kramdown:
|
|||||||
start_line: 1
|
start_line: 1
|
||||||
|
|
||||||
# DO NOT change this unless you're a Pro user on Jekyll and Web development,
|
# DO NOT change this unless you're a Pro user on Jekyll and Web development,
|
||||||
# or you think you're smart enough to change other relevant URLs within this template.
|
# Or you think you're smart enough to change other relevant URLs within this template.
|
||||||
permalink: /posts/:title/
|
permalink: /posts/:title/
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
@@ -119,55 +124,19 @@ defaults:
|
|||||||
layout: post
|
layout: post
|
||||||
comments: true # Enable comments in posts.
|
comments: true # Enable comments in posts.
|
||||||
toc: true # Display TOC column in posts.
|
toc: true # Display TOC column in posts.
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Posts
|
|
||||||
url: /
|
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: _drafts
|
path: _drafts
|
||||||
values:
|
values:
|
||||||
comments: false
|
comments: false
|
||||||
-
|
|
||||||
scope:
|
|
||||||
path: index.html
|
|
||||||
values:
|
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Posts
|
|
||||||
-
|
|
||||||
scope:
|
|
||||||
path: tags
|
|
||||||
values:
|
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Home
|
|
||||||
url: /
|
|
||||||
-
|
|
||||||
label: Tags
|
|
||||||
url: /tabs/tags/
|
|
||||||
-
|
|
||||||
scope:
|
|
||||||
path: categories
|
|
||||||
values:
|
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Home
|
|
||||||
url: /
|
|
||||||
-
|
|
||||||
label: Categories
|
|
||||||
url: /tabs/categories/
|
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: ''
|
path: ''
|
||||||
type: tabs # see `site.collections`
|
type: tabs # see `site.collections`
|
||||||
values:
|
values:
|
||||||
layout: page
|
layout: page
|
||||||
|
permalink: /:title/
|
||||||
dynamic_title: true # Hide title in mobile screens.
|
dynamic_title: true # Hide title in mobile screens.
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Home
|
|
||||||
url: /
|
|
||||||
|
|
||||||
sass:
|
sass:
|
||||||
style: compressed
|
style: compressed
|
||||||
@@ -183,8 +152,9 @@ compress_html:
|
|||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
- vendor
|
- vendor
|
||||||
- Gemfile.lock
|
|
||||||
- Gemfile
|
- Gemfile
|
||||||
|
- Gemfile.lock
|
||||||
|
- jekyll-theme-chirpy.gemspec
|
||||||
- tools
|
- tools
|
||||||
- docs
|
- docs
|
||||||
- README.md
|
- README.md
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="disqus" class="pt-2 pb-2">
|
<div id="disqus" class="pt-2 pb-2">
|
||||||
<p class="text-center text-muted pb-5">
|
<p class="text-center text-muted small pb-5">
|
||||||
Loading comments from <a href="https://disqus.com/">Disqus</a> ...
|
Loading comments from <a href="https://disqus.com/">Disqus</a> ...
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
<p>{{ page.previous.title }}</p>
|
<p>{{ page.previous.title }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="btn btn-outline-primary disabled">
|
<span class="btn btn-outline-primary disabled"
|
||||||
|
prompt="{{ site.data.label.post.button.previous | default: 'previous' }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -20,7 +21,8 @@
|
|||||||
<p>{{ page.next.title }}</p>
|
<p>{{ page.next.title }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="btn btn-outline-primary disabled">
|
<span class="btn btn-outline-primary disabled"
|
||||||
|
prompt="{{ site.data.label.post.button.next | default: 'next' }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -5,21 +5,42 @@
|
|||||||
<div id="topbar-wrapper" class="row justify-content-center topbar-down">
|
<div id="topbar-wrapper" class="row justify-content-center topbar-down">
|
||||||
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
|
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
|
||||||
<span id="breadcrumb">
|
<span id="breadcrumb">
|
||||||
{% for item in page.breadcrumb %}
|
|
||||||
{% if item.url %}
|
{% assign paths = page.url | split: '/' %}
|
||||||
|
|
||||||
|
{% if paths.size == 0 %}
|
||||||
|
<!-- index page -->
|
||||||
|
<span>{{ 'Posts' }}</span>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% for item in paths %}
|
||||||
|
|
||||||
|
{% if forloop.first %}
|
||||||
|
{% unless page.layout == 'post' %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ site.baseurl }}{{ item.url | remove: '.html'}}">
|
<a href="{{ '/' | relative_url }}">{{ 'Home' }}</a>
|
||||||
{{ item.label }}
|
</span>
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
{% elsif forloop.last %}
|
||||||
|
<span>{{ page.title }}</span>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
<span>
|
||||||
|
{% assign url = item %}
|
||||||
|
{% if item == 'posts' and page.layout == 'post' %}
|
||||||
|
{% assign url = '/' %}
|
||||||
|
{% endif %}
|
||||||
|
<a href="{{ url | relative_url }}">
|
||||||
|
{{ item | capitalize }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
|
||||||
<span>{{ item.label }}</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% unless page.layout == "home" %}
|
{% endif %}
|
||||||
<span>{{ page.title }}</span>
|
|
||||||
{% endunless %}
|
|
||||||
|
|
||||||
</span><!-- endof #breadcrumb -->
|
</span><!-- endof #breadcrumb -->
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ layout: compress
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<html lang="{{ site.lang | split: "_" | first | default: "en" }}" {{ prefer_mode }}>
|
<html lang="{{ site.lang | default: "en-US" }}" {{ prefer_mode }}>
|
||||||
|
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ layout: default
|
|||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
|
||||||
{% if page.image %}
|
{% if page.image.src %}
|
||||||
<img src="{{ page.image }}" class="preview-img" alt="Preview Image">
|
<img src="{{ page.image.src }}" class="preview-img" alt="{{ page.image.alt | default: "Preview Image" }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ categories: [Blogging, Demo]
|
|||||||
tags: [typography]
|
tags: [typography]
|
||||||
math: true
|
math: true
|
||||||
mermaid: true
|
mermaid: true
|
||||||
image: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png
|
image:
|
||||||
|
src: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png
|
||||||
---
|
---
|
||||||
|
|
||||||
This post is to show Markdown syntax rendering on [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork), you can also use it as an example of writing. Now, let's start looking at text and typography.
|
This post is to show Markdown syntax rendering on [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork), you can also use it as an example of writing. Now, let's start looking at text and typography.
|
||||||
|
|||||||
@@ -84,11 +84,13 @@ Then you can use it like other markdown language: surround the graph code with `
|
|||||||
|
|
||||||
### Preview image
|
### Preview image
|
||||||
|
|
||||||
If you want to add an image to the top of the post contents, specify the url for the image by:
|
If you want to add an image to the top of the post contents, specify the url and alt attribute for the image:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
image: /path/to/image-file
|
image:
|
||||||
|
src: /path/to/image/file
|
||||||
|
alt: image alternative text
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete th
|
|||||||
|
|
||||||
There are two ways to get the theme:
|
There are two ways to get the theme:
|
||||||
|
|
||||||
- Install from [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy)
|
- **Install from RubyGems** - Easy to upgrade, isolate irrelevant project files so you can focus on writing.
|
||||||
- Fork from GitHub
|
- **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`:
|
Add this line to your Jekyll site's `Gemfile`:
|
||||||
|
|
||||||
@@ -38,15 +38,15 @@ And then execute:
|
|||||||
$ bundle
|
$ 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 theme’s gem, execute:
|
> **Hint**: To locate the installed theme’s gem, execute:
|
||||||
>
|
>
|
||||||
```console
|
```console
|
||||||
$ bundle info --path jekyll-theme-chirpy
|
$ 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
|
### Fork From GitHub
|
||||||
|
|
||||||
@@ -69,7 +69,6 @@ $ bash tools/init.sh
|
|||||||
What it does is:
|
What it does is:
|
||||||
|
|
||||||
1. Remove some files or directories from your repository:
|
1. Remove some files or directories from your repository:
|
||||||
|
|
||||||
- `.travis.yml`
|
- `.travis.yml`
|
||||||
- files under `_posts`
|
- files under `_posts`
|
||||||
- folder `docs`
|
- folder `docs`
|
||||||
@@ -78,7 +77,6 @@ What it does is:
|
|||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Automatically create a commit to save the changes.
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
@@ -88,7 +86,7 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
|
|||||||
- `url`
|
- `url`
|
||||||
- `avatar`
|
- `avatar`
|
||||||
- `timezone`
|
- `timezone`
|
||||||
- `theme_mode`
|
- `lang`
|
||||||
|
|
||||||
### Running Local Server
|
### Running Local Server
|
||||||
|
|
||||||
@@ -121,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:
|
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.
|
- 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.
|
- 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.
|
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.
|
||||||
|
|
||||||
@@ -157,3 +155,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 your web server.
|
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.
|
||||||
|
|
||||||
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
|
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||||
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* The styles for Jekyll theme Chirpy
|
* The styles for Jekyll theme Chirpy
|
||||||
*
|
*
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
@include align-center;
|
@include align-center;
|
||||||
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 2.5rem;
|
margin-bottom: 2.5rem !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +85,12 @@
|
|||||||
&.btn-outline-primary.disabled:focus {
|
&.btn-outline-primary.disabled:focus {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
&::before {
|
||||||
|
color: var(--text-muted-color);
|
||||||
|
font-size: 0.65rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
content: attr(prompt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@@ -95,12 +101,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
&::before {
|
|
||||||
color: var(--text-muted-color);
|
|
||||||
font-size: 0.65rem;
|
|
||||||
text-transform: uppercase;
|
|
||||||
content: attr(prompt);
|
|
||||||
}
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
@@ -112,6 +112,7 @@
|
|||||||
right: 0.5px;
|
right: 0.5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .post-navigation
|
} // .post-navigation
|
||||||
|
|
||||||
@keyframes fade-up {
|
@keyframes fade-up {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
2
assets/js/dist/categories.min.js
vendored
2
assets/js/dist/categories.min.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
2
assets/js/dist/home.min.js
vendored
2
assets/js/dist/home.min.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
2
assets/js/dist/page.min.js
vendored
2
assets/js/dist/page.min.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
2
assets/js/dist/post.min.js
vendored
2
assets/js/dist/post.min.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
2
assets/js/dist/pvreport.min.js
vendored
2
assets/js/dist/pvreport.min.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v3.0.3 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v3.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
Language: [English](https://github.com/cotes2020/jekyll-theme-chirpy#readme) | 简体中文
|
Language: [English](https://github.com/cotes2020/jekyll-theme-chirpy#readme) | 简体中文
|
||||||
|
|
||||||
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
[](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)
|
[](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)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[](https://996.icu)
|
[](https://996.icu)
|
||||||
|
|
||||||
一个不一样的 Jekyll 主题,采用响应式设计,方便记录、管理、分享你的知识和经验。[懂的进 »](https://chirpy.cotes.info)
|
一个不一样的 Jekyll 主题,采用响应式设计,方便记录、管理、分享您的知识和经验。[懂的进 »](https://chirpy.cotes.info)
|
||||||
|
|
||||||
[](https://chirpy.cotes.info)
|
[](https://chirpy.cotes.info)
|
||||||
|
|
||||||
@@ -54,18 +55,18 @@ Language: [English](https://github.com/cotes2020/jekyll-theme-chirpy#readme) |
|
|||||||
|
|
||||||
有二法可得此主题:
|
有二法可得此主题:
|
||||||
|
|
||||||
- 从 [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy) 安装
|
- **从 RubyGems 安装** - 易于版本升级,隔离无关的主题项目文件,让您的仓库舒适清爽。
|
||||||
- 从 GitHub 上 Fork
|
- **从 GitHub 上 Fork** - 对个性化二次开发友好,但是难于升级,只适合专业开发人员使用。
|
||||||
|
|
||||||
### Rubygems 安装
|
### RubyGems 安装
|
||||||
|
|
||||||
在你的 Jekyll 站点的 `Gemfile` 添加:
|
在您的 Jekyll 站点的 `Gemfile` 添加:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
gem "jekyll-theme-chirpy"
|
gem "jekyll-theme-chirpy"
|
||||||
```
|
```
|
||||||
|
|
||||||
然后,添加这行到你的 Jekyll 站点的 `_config.yml`:
|
然后,添加这行到您的 Jekyll 站点的 `_config.yml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
theme: jekyll-theme-chirpy
|
theme: jekyll-theme-chirpy
|
||||||
@@ -77,7 +78,7 @@ theme: jekyll-theme-chirpy
|
|||||||
$ bundle
|
$ bundle
|
||||||
```
|
```
|
||||||
|
|
||||||
最后, 拷贝额外所需主题的 gem 文件(详见 [starter 项目][starter] 的文件目录)至你的 Jekyll 站点, 然后把主题的 `_config.yml` 全部内容附加到你的 Jekyll 站点的同名文件。
|
最后, 拷贝额外所需主题的 gem 文件(详见 [starter 项目][starter] 的文件目录)至您的 Jekyll 站点, 然后把主题的 `_config.yml` 全部内容附加到您的 Jekyll 站点的同名文件。
|
||||||
|
|
||||||
> **提示**: 定位主题的 gem 文件,可以执行:
|
> **提示**: 定位主题的 gem 文件,可以执行:
|
||||||
>
|
>
|
||||||
@@ -85,7 +86,7 @@ $ bundle
|
|||||||
$ bundle info --path jekyll-theme-chirpy
|
$ bundle info --path jekyll-theme-chirpy
|
||||||
```
|
```
|
||||||
|
|
||||||
或者你可以 [使用 starter template][use-starter] 来快速创建 Jekyll 站点,以省去复制主题 gem 文件的时间。
|
或者您可以 [使用 starter template][use-starter] 来快速创建 Jekyll 站点,以省去复制主题 gem 文件的时间。
|
||||||
|
|
||||||
### 在 GitHub 上 Fork
|
### 在 GitHub 上 Fork
|
||||||
|
|
||||||
@@ -103,11 +104,11 @@ $ bundle
|
|||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> 如果你不打算部署到 GitHub Pages, 在上述命令后附加参数选项 `--no-gh`。
|
> 如果您不打算部署到 GitHub Pages, 在上述命令后附加参数选项 `--no-gh`。
|
||||||
|
|
||||||
上述脚本完成了以下工作:
|
上述脚本完成了以下工作:
|
||||||
|
|
||||||
1. 从你的仓库中删除了:
|
1. 从您的仓库中删除了:
|
||||||
- `.travis.yml`
|
- `.travis.yml`
|
||||||
- `_posts` 下的文件
|
- `_posts` 下的文件
|
||||||
- `docs` 目录
|
- `docs` 目录
|
||||||
@@ -125,7 +126,7 @@ $ bash tools/init.sh
|
|||||||
- `url`
|
- `url`
|
||||||
- `avatar`
|
- `avatar`
|
||||||
- `timezone`
|
- `timezone`
|
||||||
- `theme_mode`
|
- `lang`
|
||||||
|
|
||||||
### 本地运行
|
### 本地运行
|
||||||
|
|
||||||
@@ -148,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
|
#### 部署到 GitHub Pages
|
||||||
|
|
||||||
@@ -158,10 +159,10 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||
快速检查 GitHub Actions 构建需要的文件:
|
快速检查 GitHub Actions 构建需要的文件:
|
||||||
|
|
||||||
1. 确保你的 Jekyll 站点存在文件 `/.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和你的仓库默认分支名相同。
|
- 确保您的 Jekyll 站点存在文件 `.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和您的仓库默认分支名相同。
|
||||||
2. 检查你的 Jekyll 站点是否有文件 `/tools/test.sh` 和 `/tools/deploy.sh`. 没有的话, 从本仓库拷贝到你的 Jekyll 项目.
|
- 检查您的 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` 用来存储构建的站点文件。
|
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. 按照 GitHub 指示的地址去访问你的网站。
|
3. 按照 GitHub 指示的地址去访问您的网站。
|
||||||
|
|
||||||
#### 部署到其他 Pages 平台
|
#### 部署到其他 Pages 平台
|
||||||
|
|
||||||
@@ -221,5 +222,5 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||||
[workflow]:https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
[jb]:https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "jekyll-theme-chirpy"
|
spec.name = "jekyll-theme-chirpy"
|
||||||
spec.version = "3.0.3"
|
spec.version = "3.1.0"
|
||||||
spec.authors = ["Cotes Chung"]
|
spec.authors = ["Cotes Chung"]
|
||||||
spec.email = ["cotes.chung@gmail.com"]
|
spec.email = ["cotes.chung@gmail.com"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jekyll-theme-chirpy",
|
"name": "jekyll-theme-chirpy",
|
||||||
"version": "3.0.3",
|
"version": "3.1.0",
|
||||||
"description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.",
|
"description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|||||||
@@ -26,14 +26,20 @@ NODE_META="package.json"
|
|||||||
|
|
||||||
_check_src() {
|
_check_src() {
|
||||||
if [[ ! -f $1 && ! -d $1 ]]; then
|
if [[ ! -f $1 && ! -d $1 ]]; then
|
||||||
echo -e "Error: missing file \"$1\"!\n"
|
echo -e "Error: Missing file \"$1\"!\n"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
if [[ -n $(git status . -s) ]]; then
|
if [[ -n $(git status . -s) ]]; then
|
||||||
echo "Warning: commit unstaged files first, and then run this tool againt."
|
echo "Error: Commit unstaged files first, and then run this tool againt."
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ensure the current branch is 'master'
|
||||||
|
if [[ "$(git branch --show-current)" != "master" ]]; then
|
||||||
|
echo "Error: This operation must be performed on the 'master' branch!"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -76,13 +82,51 @@ bump() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_gem() {
|
build_gem() {
|
||||||
|
rm -f ./*.gem
|
||||||
gem build "$GEM_SPEC"
|
gem build "$GEM_SPEC"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release() {
|
||||||
|
_version="$1"
|
||||||
|
_major=""
|
||||||
|
_minor=""
|
||||||
|
|
||||||
|
IFS='.' read -r -a array <<< "$_version"
|
||||||
|
|
||||||
|
for elem in "${array[@]}"; do
|
||||||
|
if [[ -z $_major ]]; then
|
||||||
|
_major="$elem"
|
||||||
|
elif [[ -z $_minor ]]; then
|
||||||
|
_minor="$elem"
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
_release_branch="$_major-$_minor-stable"
|
||||||
|
|
||||||
|
if [[ -z $(git branch -v | grep "$_release_branch") ]]; then
|
||||||
|
git checkout -b "$_release_branch"
|
||||||
|
else
|
||||||
|
git checkout "$_release_branch"
|
||||||
|
# cherry-pick the latest 2 commit from master to release branch
|
||||||
|
git cherry-pick "$(git rev-parse master~1)" "$(git rev-parse master)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "Create tag v$_version\n"
|
||||||
|
git tag "v$_version"
|
||||||
|
|
||||||
|
build_gem
|
||||||
|
|
||||||
|
# head back to master branch
|
||||||
|
git checkout master
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
check
|
check
|
||||||
|
|
||||||
_latest_tag="$(git describe --tags --abbrev=0)"
|
_latest_tag="$(git describe --tags $(git rev-list --tags --max-count=1))"
|
||||||
|
|
||||||
echo "Input a version number (hint: latest version is ${_latest_tag:1})"
|
echo "Input a version number (hint: latest version is ${_latest_tag:1})"
|
||||||
|
|
||||||
@@ -98,16 +142,13 @@ main() {
|
|||||||
echo -e "Bump version to $_version\n"
|
echo -e "Bump version to $_version\n"
|
||||||
bump "$_version"
|
bump "$_version"
|
||||||
|
|
||||||
echo -e "Create tag v$_version\n"
|
echo -e "Release to v$_version\n"
|
||||||
git tag "v$_version"
|
release "$_version"
|
||||||
|
|
||||||
build_gem
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
echo "Error: Illegal version number: '$_version'"
|
echo "Error: Illegal version number: '$_version'"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
Reference in New Issue
Block a user