1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 13:44:15 +00:00

Compare commits

..

39 Commits
v1.0 ... v2.0

Author SHA1 Message Date
Cotes Chung
a0179b2efe Fixed the link of posts' nav-button. 2020-02-04 04:55:09 +08:00
Cotes Chung
b27ae2e436 Beautified the dark-mode color of blockquote. 2020-02-04 04:55:09 +08:00
Cotes Chung
df288e38b9 Beautified the nav-button of Posts. 2020-02-04 04:55:09 +08:00
Cotes Chung
2746c9d96f Optimize workflow. 2020-02-04 04:55:09 +08:00
Cotes Chung
ae98334edd Updated the Docs. 2020-02-04 04:55:09 +08:00
Cotes Chung
c30bfd5649 Move the CI to Github Actions. 2020-02-04 04:55:09 +08:00
Cotes Chung
47a32fcce3 Updated the CI config. 2020-02-04 04:55:09 +08:00
Cotes Chung
1f8b81965d Add Python requirements file. 2020-02-04 04:55:09 +08:00
Cotes Chung
c53f23df5c Beautified the ToC. 2020-02-04 04:55:09 +08:00
Cotes Chung
e67a74c4ec Fixed tutorial. 2020-02-04 04:55:09 +08:00
Cotes Chung
c258bbc8d9 Update label in posts. 2020-02-04 04:55:09 +08:00
Cotes Chung
9bd0b1bdf8 Optimized the position of avatar. 2020-02-04 04:55:09 +08:00
Cotes Chung
e09fd4d6c8 Beautified the table's in dark mode. 2020-02-04 04:55:09 +08:00
Cotes Chung
b09f5127ad Optimized the resource prioritization. 2020-02-04 04:55:09 +08:00
Cotes Chung
3458b9ad82 Added a new script tool to compress JS. 2020-02-04 04:55:09 +08:00
Cotes Chung
b0d6513b7c Updated README and tutorial.
Formatted README.
2020-01-14 02:57:31 +08:00
Cotes Chung
12bacea674 Create issue templates 2020-01-14 02:57:31 +08:00
Cotes Chung
26cd681802 Fixed the build tool. 2020-01-14 02:57:31 +08:00
Cotes Chung
6cef0829a8 Updated seo-tag settings.
Although `tagline` hasn't been released yet.
2020-01-14 02:57:31 +08:00
Cotes Chung
53e01c1778 Code optimization. 2020-01-14 02:57:31 +08:00
Cotes Chung
501036cafa Updated footer. 2020-01-14 02:57:31 +08:00
Cotes Chung
335b956e13 Reduce font weight of post nav-button. 2020-01-14 02:57:31 +08:00
Cotes Chung
8fcf1e35fc Dark mode color optimization. 2020-01-14 02:57:31 +08:00
Cotes Chung
ff9663f376 Fixed related URL. 2020-01-14 02:57:31 +08:00
Cotes Chung
b534ab74de Optimized the dark mode color of Categories. 2020-01-14 02:57:31 +08:00
Cotes Chung
a22d510b1d Ignore bundle cache from Git commits. 2020-01-14 02:57:31 +08:00
Cotes Chung
a812ded9cd Updated Docs. 2020-01-14 02:57:31 +08:00
Cotes Chung
34836f7703 Beautified sidebar in x-large screens.
screen width >= 1650px
2020-01-14 02:57:31 +08:00
Cotes Chung
2386fe5bd8 Another super feature: auto dark mode! 2020-01-14 02:57:31 +08:00
Cotes Chung
1c2be0c243 Updated syntax highlighter. 2020-01-14 02:57:31 +08:00
Cotes Chung
9495596f49 Changed images location and effects. 2020-01-14 02:57:31 +08:00
Cotes Chung
a42a5bfab4 Beautified the navigation button in post. 2020-01-14 02:57:31 +08:00
Cotes Chung
2ad4dc1b4e Display title in post's page button. 2020-01-14 02:57:31 +08:00
Cotes Chung
6ba47c931a Shutdown Disqus by default. 2020-01-14 02:57:31 +08:00
Cotes Chung
8591e921e4 Added more project info in files. 2020-01-14 02:57:31 +08:00
Cotes Chung
fa43f92370 Beautified the hover of related post. 2020-01-14 02:57:31 +08:00
Cotes Chung
6aac3f95fe Important: Fixed sitemap template. 2020-01-14 02:57:31 +08:00
Cotes Chung
3e004d1bf3 Moved the script tools. 2020-01-02 09:13:05 +08:00
Cotes Chung
5bb810875b Moved search cache. 2020-01-02 08:45:51 +08:00
84 changed files with 1722 additions and 576 deletions

22
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,22 @@
# How to Contribute
I want to thank you for sparing a time to improve this project! Here are some guidelines for contributing
## Bug Reporting
If you found a bug, please ensure it doesn't appear in other existing [issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues). After that, [create a new issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues/new/choose) with template `Bug Report` and follow it's illustration to describe the situation.
## Code Optimization
If you are willing to improve some of the existing code, such as performance optimization, code simplification, or even correct spelling errors of variable names, please submit a new PR to help us.
## Feature Request
Basically, it is recommended to first submit a `Feature Request` issue to discuss whether your idea fits the project. Once the discussion is complete and the request is approved, fork this project, complete the development of new features, and submit a Pull Request. What's more, the PR should be merged into `master` branch without conflict.
---
:tada:Your volunteering will make the open source world more beautiful, thanks again!:tada:

2
.github/FUNDING.yml vendored
View File

@@ -1 +1 @@
custom: ['https://www.buymeacoffee.com/6wOkxTo', 'https://cotes.gitee.io/alipay-wechat-donation']
custom: ['https://www.buymeacoffee.com/coteschung', 'https://cotes.gitee.io/alipay-wechat-donation']

39
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,39 @@
---
name: Bug Report
about: Create a report to help us improve
labels: bug
---
<!-- Please make sure you have read the README or Wiki, and your question does not appear in other existing issues (including closed ones). Thanks for your cooperation! Now let's start it. -->
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->
**To Reproduce**
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
<!-- Add any other context about the problem here. -->

View File

@@ -0,0 +1,21 @@
---
name: Feature Request
about: Suggest an idea for this project
labels: feature-suggestion
---
<!-- Please make sure your request does not appear in other existing issues (including closed ones). Thanks for your cooperation. Now, I can't wait to listen your idea! -->
**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->

57
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@@ -0,0 +1,57 @@
---
name: Question
about: Ask what ever you want
labels: question
---
<!-- Please make sure you have read the README or Wiki, and your question does not appear in other existing issues (including closed ones). Thanks for your cooperation. Now, uncomment the relevant part to describe the situation. -->
<!--
**Don't understand what the README or Wiki says.**
Point out the parts that are hard for you to understand.
-->
<!--
**Want to complain about my bad days.**
Don't hesitate to share your story!
-->
<!--
**Just wanted to say hi to the author.**
Hi, I'm ..., have a nice day !
-->
<!--
**Not sure if it's a bug**
Please try to describe the problem
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
-->

84
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,84 @@
name: build
on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'LICENSE'
- '.travis.yml'
pull_request:
paths:
- "**"
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6.x'
- uses: actions/setup-python@v1
with:
python-version: '3.7.x'
- name: Checkout
uses: actions/checkout@v2
- name: Bundle Caching
id: bundle-cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- id: get-pip-cache-path
run: |
echo "::set-output name=path::`pip show pip | grep "Location" | awk '{print $2}'`"
- name: Pip caching
id: pip-cache
uses: actions/cache@v1
with:
path: ${{ steps.get-pip-cache-path.outputs.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install gnu-coreutils for macOS
if: runner.os == 'macOS'
run: |
brew install coreutils
- name: Bundle config
run: |
bundle config path vendor/bundle
- name: Bundle Install
if: steps.bundle-cache.outputs.cache-hit != 'true'
run: |
bundle install
- name: Bundle Install locally
if: steps.bundle-cache.outputs.cache-hit == 'true'
run: |
bundle install --local
- name: Pip installing
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
pip install -r _scripts/py/requirements.txt
- name: Build Site
run: |
bash tools/build.sh
- name: Test Site
run: |
bash tools/test.sh

6
.gitignore vendored
View File

@@ -1,4 +1,7 @@
# hidden files
.*
# python compiled files
*.pyc
# jekyll debug
@@ -9,3 +12,6 @@ Gemfile.lock
# yui-compressor
*.jar
# bundle cache
vendor

View File

@@ -1,12 +1,14 @@
os: linux
dist: bionic
language: ruby
rvm: 2.5.3
rvm: 2.6.5
before_install:
- pyenv global 3.7.1
- pyenv global 3.7.5
install:
- pip install --upgrade pip
- pip install ruamel.yaml
- pip install -r _scripts/py/requirements.txt
- bundle install --path vendor/bundle --quiet
addons:
@@ -15,7 +17,11 @@ addons:
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
script:
- bash _scripts/travis/cibuild.sh
- >-
git clone https://${GH_PAT}@github.com/${GH_USER}/${BUILDER_REPO}.git
${HOME}/${BUILDER_REPO} --depth=1 -q
- cp -r ${HOME}/${BUILDER_REPO}/framework/* .
- bash _cibuild.sh
branches:
only: master
@@ -26,15 +32,13 @@ git:
cache:
directories:
- $TRAVIS_BUILD_DIR/vendor/bundle
- $TRAVIS_BUILD_DIR/tmp/.htmlproofer
notifications:
email:
recipients:
- secure: "GdZFhI2fu6MHwHeGkI9AI8NJexfT+cncJKoOTBxrMPywxvfm6HZ1vZTOwLD9mwG4XZUSznruD4NwRiXMBKs/94n8Z2f0QagCp2is/TuQWBVDUn1bowTbx1S7da6I3qTBGyIHvQWySwFgJuK9/uUeHdQF9ojMejESKZWfc6NjlgYie3Us3ax+Lygq6o4x+8+YPqlC/XwEKUUMUpXZT8Yubxg+s1mLwY9zmp2kJwB1snf6u498FPCWtCuQdGc91HEL4McfUfevnkNKttJQFwdE+mFkLoLn1FcXN0WQ8hPVTQvD/5TaCvACuB1oQ4dm4cnnoIRC5iuQntkP2Am7jPLnHLwxHDqB8vLDNxi1phbfGTk89ffY4n5FirF7DiYIn7hDDbDBlE4++9Pv/i7xgLp9+NzAzz25tdcfKZfXujrwE6b/2NbtXer/eWXyi7d6V/qWO6x8m7/IerX2/VrbXyQIgTvIDe2sSAraM77MMIiQ2KS6yhPIfjyCsC1sokFNRqUWut2UkqMFKOmAnSi/jTQY6/t1aOXGHtVRwgjFoyvBTk9F9NElxt3mseK26Mad3yAv5xLqhqHPFZJbVHJ8dP6RQvWwuvMK1uSqobTl+t0qBvvdSbt1/Oc/ubN1T2clObx1faF2luoMFhRtN+H5s7wfEMrO+sJAuSZnAHuDRpDIwCs="
- secure: "fFLqX7uOzFA8RE2AUFlU1mmxMw+rdV6DnODJ/1Gl+3ecNtrv5LeH3c5a4a5ShQqYTrx9BPfD40VRN7UB+lzOdXiWLI9yDGRPPxGG26/WfrKpdQPZilc8zAOEeDnLAJeGZLsUvgmNb3KCXW6S8NPqqh34CfWcTIzjCARhRgO33wcs8X5wP5cugtNqO5Ew/pUcfWcmiuXNX0GNT6l+nL5A7yN+IO5mRHqSRmlfYd5EHhGMTIL4La+Cd1CNv1m4Dl0Ah2cDeJwi5wLnVbqAgunLhAYmDtxIOCVYMTBrP37UiNe/7QeFelyJfODsmMg1mx3WCykbXydC753WVoAlTg6nNoeeI9fmK+/tuLK+sx/KnYfTVGBXQYq39DyV/2o/IfCzEAKImlzFKGD8R13+ddu4B5UML+cby5KBvhTKIGaC5tKoe39z/31UPpy11/EHMCof2BUOzIgu5Hsv4OSNJlw3oRE31oOPn8xP4e7uWR8bRUhAgzN0Cn0ht+UfpemfGAXrp0M3IXQdc9L4azEFqxRhivMTLK/P6INay7IM+DJ30Ht2dWylGw/sxcRTqyNm3YomJQnXIO4xeqTSLulWr80FFHTys3JEDJYrcKvJmpwLFEAOZtwKsZ6ZShrOIA4LE5fgQtakH3ZLJG9a7jVSlMcNIfaSKgjdDQOe6CoRQL7KouA="
on_success: never
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
- secure: "QNAqDoDQ+mF/3DFxKbc7fnYa5+FysJTX9Vs4XneH6iH63MS2lNtHfC7uT/M0/sRJaygK9eAdb+RaIeADE7CAMzqP3qdWx7l2N6qWab/kyK9KujUBsvoTGX6lDQTwC2Z+zlr5uUScHfLOhqHh6dbm6glziy2NB4dn9pVBXQrmBn09Rf9LImRT2u2h8gzmdl19hZ9TsW1/ROOb/1Soc3JElGRPrIxKI7ufHLQZt0UzZkYXGejQJwtstEEkRSmhfkJjlASeaeuyOFBvkWXjL1nKPsElwEKsAR+4II98JKA83YVqa9TJT2YSnXeLEFIhYDVSG6RLAMEU4rrITzRYC/hWKBKje4G0PDEM/cpnytk9Xhq+7oUFRmXCq3ZQgTQgzWhzl1kExC8b96hiWmQ+lVCw+Q2BG6+NloEEuOHOM839CTXfiitjRJ8KYUdLgW6IaruaingySBsbh1Vl+Dhu73QZ5H40KLdIH6woLXWAgtxkjpaL6DTeWDO6xMiwDreBa/2CJRT5R1tiG45CurZ+AkQ+yAAfSOEwGtE29oZl0sWeWMwVTaAClc0IJaG1+h8jxIVuQqHvK3fzd5RdlDtShrfCCVvQD0n29wXrdeNEg90F92kvdtmw8XgKc2P/Cl5uNzvVeTbFF3ZIHYpCVV4LW4Hn8clgYu+WUa/w4pVrBSdQOUw="

View File

@@ -1,13 +1,14 @@
---
# The 404 page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
layout: page
title: "404: Page not found"
permalink: /404.html
redirect_from: # Same as site.blocklist
redirect_from: # part of site.sitemap_exclude
- /norobots/
- /assets/
- /tabs/

14
Gemfile
View File

@@ -1,17 +1,17 @@
source 'https://rubygems.org'
source "https://rubygems.org"
gem 'jekyll', '>=3.8.6'
gem "jekyll", ">=3.8.6"
# Official Plugins
group :jekyll_plugins do
gem 'jekyll-paginate'
gem 'jekyll-redirect-from'
gem 'jekyll-seo-tag'
gem "jekyll-paginate"
gem "jekyll-redirect-from"
gem "jekyll-seo-tag", "~> 2.6.1"
end
group :test do
gem 'html-proofer'
gem "html-proofer"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

187
README.md
View File

@@ -1,49 +1,87 @@
# Jekyll Theme Chirpy
[![Build Status](https://travis-ci.com/cotes2020/jekyll-theme-chirpy.svg?branch=master)](https://travis-ci.com/cotes2020/jekyll-theme-chirpy)
[![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)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
![devices-mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)
Language: English | [简体中文](docs/README_zh-CN.md)
A minimal, portfolio, sidebar, bootstrap Jekyll theme with responsive web design and focuses on text presentation. Hope you like it! [Live Demo »](https://chirpy.cotes.info)
A minimal, portfolio, sidebar, bootstrap Jekyll theme with responsive web design and focuses on text exhibition. It will help you easily record, manage and share your knowledge and experience.
## Features
You will get the following features:
* Auto Dark Mode
* Posts' Last Modified Date
* Table of Contents
* Disqus Comments
* Automatically Recommend Related Posts
* Syntax highlighting
* Two Level Categories
* Search
* HTML Compress
* Atom Feeds
* Disqus Comments
* Google Analytics
* GA Pageviews (Advanced)
* SEO Tag
* Performance Optimization
## Getting Started
[**Live Demo** »](https://chirpy.cotes.info)
### Preparation
![devices-mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (Ruby, RubyGem, Bundler and Jekyll). In addition, to use the funny script tools, 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/).
## Table of Contents
Next, [fork](https://github.com/cotes2020/jekyll-theme-chirpy/fork) **Chirpy** and then clone your replicated repository locally.
* [Installing](#installing)
* [Usage](#usage)
* [Contributing](#contributing)
* [Credits](#credits)
* [Support](#support)
* [License](#license)
### Install Jekyll Plugins
## Installing
Go to root directory of the repository and run the following:
### Prerequisites
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/).
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:
* Debian
```console
$ sudo apt-get install coreutils
```
* macOS
```console
$ brew install coreutils
```
### Jekyll Plugins
[Fork **Chirpy** from GitHub](https://github.com/cotes2020/jekyll-theme-chirpy/fork), then clone your forked repo to local:
```console
$ git clone git@github.com:USER/jekyll-theme-chirpy.git
```
replace the `USER` above to your GitHub username.
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:
```terminal
$ bundle install
```
`bundle` will install all the dependent Jekyll Plugins listed in file `Gemfile` automatically.
`bundle` will automatically install all the dependent Jekyll Plugins that listed in the `Gemfile`.
### File Structure
## Usage
### Directory Structure
The main files and related brief introductions are listed below.
@@ -54,8 +92,8 @@ jekyll-theme-chirpy/
├── _layouts
├── _posts # posts stay here
├── _scripts
│ └── travis # CI stuff, remove it
├── .travis.yml # remove it, too
── .travis.yml # remove it
├── .github # remove this, too
├── assets
├── tabs
│   └── about.md # the ABOUT page
@@ -65,32 +103,32 @@ jekyll-theme-chirpy/
├── LICENSE
├── README.md
├── _config.yml # configuration file
├── build.sh # script tool
├── run.sh # script tool
├── init.sh # script tool
├── pv.sh
├── tools # script tools
├── docs
├── feed.xml
├── index.html
├── robots.txt
├── search.json
└── sitemap.xml
```
### Configuration
As mentioned above, some files or directories should be removed from your repo:
Customize the variables in file `_config.yml` as needed.
- .travis.yml
- .github
### Atom Feed
### Customization
The Atom feed url of your site will be:
Basically, go to `_config.yml` and customize the variables as needed, some of them are typical options:
```
<SITE_URL>/feed.xml
```
* Avatar
The `SITE_URL` was defined by variable `url` in file `_config.yml`.
`avatar` defines the source image location. The sample image is `/assets/img/sample/avatar.jpg`. It should be replaced by your own one. Notice that a huge image file will increase the load time of your site, so keep your avatar size as samll as possible(may be *<https://tinypng.com/>* will help).
* TimeZone
To ensure that the posts' release date matches the city you live in, please modify the field `timezone` correctly. A list of all available values can be found on [TimezoneConverter](http://www.timezoneconverter.com/cgi-bin/findzone/findzone) or [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
### Run Locally
@@ -98,62 +136,101 @@ The `SITE_URL` was defined by variable `url` in file `_config.yml`.
You may want to preview the site before publishing, so just run the script tool:
```terminal
$ bash run.sh
$ bash tools/run.sh
```
>**Note**: The *Recent Update* list requires the latest git-log date of posts, thus make sure the changes in `_posts` have been committed before running this command.
Open a brower and visit <http://localhost:4000>.
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
Open a modern brower and visit at <http://localhost:4000>.
Few days later, you may find that the file modification(e.g. edits to a post) does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine. Type `-h` for more information.
### Deploying to GitHub Pages
Before the deployment begins, ensure the `url` in `_config.yml` has been set to `https://<username>.github.io`.
Before the deployment begins, ensure the `url` in file `_config.yml` has been set to `https://<username>.github.io`(or the custom domain, if you have. e.g. `https://yourdomain.com`). What's more, if you prefer to the [Project site](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites), change `baseurl` of file `_config.yml` to your project name, starting with a slash. e.g. `/project`.
#### Option 1: Built by GitHub Pages
By deploying your site in this way, you can push the source code to GitHub repository directly.
By deploying the site in this way, you're allowed to push the source code directly to the remote.
> **Note**: If you want to add any third-party Jekyll plugins or custom scripts to your project, please refer to [*Option 2: Build locally*](#option-2-build-locally).
> **Note**: If you want to use any third-party Jekyll plugins that not in [this list](https://pages.github.com/versions/), stop reading the current approach and go to [*Option 2: Build locally*](#option-2-build-locally).
**1**. Rename your repository as `<username>.github.io`.
**1**. Rename the repository to:
**2**. Commit the changes of your repository, then run the initialization script:
|Site Type | Repo's Name|
|:---|:---|
|User or Organization | `<username>.github.io`|
|Project| any one except `<username>.github.io`, let's say `project`|
```console
$ bash init.sh
**2**. Commit the changes of the repo first, then run the initialization script:
```terminal
$ bash tools/init.sh
```
It will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts.
>**Note**: The *Recent Update* requires the posts' latest git-log date, so make sure the changes in `_posts` have been committed before running this command.
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repository `<username>.github.io`.
it will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts.
**4**. Visit `https://<username>.github.io` and enjoy.
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repo.
**4**. Check it out:
|Site Type | Site URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
#### Option 2: Build Locally
For security reasons, GitHub Pages runs on `safe` mode, which means the third-party Jekyll plugins or custom scripts will not work. If you want to use any another third-party Jekyll plugins, **your have to build locally rather than on GitHub Pages**.
For security reasons, GitHub Pages runs on `safe` mode, which means the third-party Jekyll plugins or custom scripts won't work. If you want to use any another plugins that not in the [whitelist](https://pages.github.com/versions/), **you have to generate the site locally rather than on GitHub Pages**.
**1**. On GitHub website, create a brand new repository with name `<username>.github.io` and then clone it locally.
**1**. Browse to GitHub website, create a brand new repo named:
**2**. Build your site by:
|Site Type | Repo's Name|
|:---|:---|
|User or Organization | `<username>.github.io`|
|Project| any one except `<username>.github.io`, let's say `project`|
and clone it.
**2**. In the root of the source project, build your site by:
```console
$ bash build.sh -d /path/to/<username>.github.io/
$ bash tools/build.sh -d /path/to/local/project/
```
The build results will be stored in the root directory of `<username>.github.io` and don't forget to push the changes of `<username>.github.io` to branch `master` on GitHub.
The generated static files will be placed in the root of `/path/to/local/project`. Commit and push the changes to the `master` branch on GitHub.
**3**. Go to GitHub website and enable GitHub Pages service for the new repository `<username>.github.io`.
**3**. Go to GitHub website and enable Pages service for the new repository.
**4**. Visit `https://<username>.github.io` and enjoy.
**4**. Visit at:
## Documentation
|Site Type | Site URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
For more information, please see the [tutorial](https://chirpy.cotes.info/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki).
and enjoy!
### Documentation
For more details and the better reading experience, please check out the [tutorial in demo site](https://chirpy.cotes.info/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki).
## Contributing
The old saying: "Tow heads are better than one. Five heads are better than two." So, welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
## Credits
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools(their copyright information can be found in the relevant files).
:tada:Thanks to all the volunteers who contributed to this project, their github ID is on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget the guys who submitted the issues(or unmerged PR), they reported bugs, shared ideas or inspired me to write more readable documentation.
## Support
If you enjoy this theme or find it helpful, please consider becoming my sponsor, I'd really appreciate it! Click the button <kbd>:heart:Sponsor</kbd> at the top of the [Home Page](https://github.com/cotes2020/jekyll-theme-chirpy) and choose a link that suits you to donate. This will encourage me and help me maintain this project.
## License

View File

@@ -1,4 +1,6 @@
# The Site Settings
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT licensed
@@ -6,16 +8,19 @@
# jekyll-seo-tag settings https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
#--------------------------
title: Chirpy
title: Chirpy # the main title
description: 'A text-based Jekyll theme.'
tagline: A text-focused Jekyll theme. # it will display as the sub-title
description: >- # used by seo meta and the atom feed
A minimal, portfolio, sidebar, bootstrap Jekyll theme with responsive web design and focuses on text presentation.
# Replace with your domain, e.g. 'https://username.github.io'
url: 'https://www.example.com'
url: 'protocol://domain'
author: your_full_name # change to your full name
avatar: /assets/img/sample/avatar.jpg # Support network resources.
avatar: /assets/img/sample/avatar.jpg # support internet resources
github:
username: github_username # change to your github username
@@ -38,6 +43,9 @@ google_site_verification: google_meta_tag_verification # change to your verifica
#--------------------------
# if your site type is Project Pages site, change below value to '/projectname'
baseurl: ''
# Change to your timezone http://www.timezoneconverter.com/cgi-bin/findzone/findzone
timezone: Asia/Shanghai
@@ -53,19 +61,15 @@ google_analytics:
disqus:
shortname: 'disqus' # Change to your Disqus shortname. https://help.disqus.com/en/articles/1717111-what-s-a-shortname
comments: true # boolean type, the global switch for posts comments.
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
# The year your website was first run.
# The year your website first ran.
first_run: 2019
# boolean type, global switch for ToC in posts.
toc: true
# if your site type is Project Pages site, change below value to '/projectname'
baseurl: ''
paginate: 10
markdown: kramdown
@@ -139,6 +143,12 @@ defaults:
-
label: Home
url: /
-
scope:
path: assets/data
values:
layout: compress
sass:
sass_dir: /assets/css
@@ -154,21 +164,23 @@ compress_html:
envs: []
exclude:
- vendor/ # Avoid Jekyll mistakenly read the vender directory on Travis-CI's VM .
- vendor # Avoid Jekyll mistakenly read the vender directory on Travis-CI's VM .
- Gemfile.lock
- Gemfile
- run.sh
- build.sh
- init.sh
- pv.sh
- tools
- docs
sitemap_exclude: # Sitemap will exclude the following items.
- /norobots/
fuzzy:
- /assets/
accurate:
- /norobots/
- /tabs/
- /categories/
- /tags/
- /posts/
- /404.html
- /redirects.json
- /search.json
- 404.html
- feed.xml
- sitemap.xml
- robots.txt
- redirects.json

View File

@@ -1,4 +1,6 @@
# The label text of site.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
@@ -14,4 +16,7 @@ panel:
trending_tags: "Trending Tags"
toc: "Contents"
post:
relate_posts: "Further Reading"
search_hint: "Search" # text show on search bar

View File

@@ -1,5 +1,7 @@
<!--
Define the liquid date formats.
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
Published under the MIT License
-->

View File

@@ -1,6 +1,8 @@
<!--
The Disqus lazy loading.
Powered by: https://osvaldas.info/lazy-loading-disqus-comments
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
-->

View File

@@ -1,6 +1,8 @@
<!--
The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps
Generated by: https://www.favicon-generator.org/
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
Published under the MIT license
-->

View File

@@ -1,5 +1,7 @@
<!--
The Footer
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->
@@ -12,7 +14,7 @@
<p class="mb-0">
© {% if last > first %}{{ first }}-{% endif %}{{-last-}}
<a href="{{ site.social.links[0] }}" class="ml-1">{{ site.social.name }}</a>.
<br>Powered by <a href="https://jekyllrb.com" target="_blank">Jekyll</a> & <a href="https://github.com/cotes2020/jekyll-theme-chirpy/">Chirpy</a>, hosted on <a href="https://pages.github.com/" target="_blank">GitHub Pages</a>.
<br>Powered by <a href="https://jekyllrb.com" target="_blank">Jekyll</a>, theme by <a href="https://github.com/cotes2020/jekyll-theme-chirpy/">Chirpy</a>.
</p>
</div>
<div class="license">

View File

@@ -1,5 +1,7 @@
<!--
The GA snippet
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->

View File

@@ -1,10 +1,15 @@
<!--
The Head
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>
{%- if page.layout == "home" -%}
{{- site.title -}}
@@ -12,8 +17,6 @@
{{ page.title }} | {{ site.title }}
{%- endif -%}
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% seo title=false %}
@@ -37,9 +40,21 @@
{% endif %}
{% endif %}
<!-- jsdelivr CDN -->
<link rel="preconnect" href="cdn.jsdelivr.net">
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
<link rel="preload" as="style"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin>
<link rel="preload" as="style"
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css"
integrity="sha256-+N4/V/SbAFiW1MPBCXnfnP9QSN3+Keu+NlB+0ev/YKQ="
crossorigin="anonymous">
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/main.css">
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
@@ -52,29 +67,44 @@
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css">
{% if page.layout == 'home' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/home.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/home.css">
{% endif %}
{% if page.title == 'Categories' and page.layout == 'page' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/categories.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/categories.css">
{% endif %}
{% if page.title == 'Tags' and page.layout == 'page' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/tags.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/tags.css">
{% endif %}
{% if page.layout == 'category' or page.layout == 'tag' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/category-tag.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/category-tag.css">
{% endif %}
{% if page.title == 'Archives' and page.layout == 'page' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/archives.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/archives.css">
{% endif %}
{% if page.title == 'About' and page.layout == 'page' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/syntax.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/syntax.css">
{% endif %}
<link rel="preload" as="script"
href="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
<link rel="preload" as="script"
href="https://cdn.jsdelivr.net/npm/popper.js@1.15.0/dist/umd/popper.min.js"
integrity="sha256-fTuUgtT7O2rqoImwjrhDgbXTKUwyxxujIMRIK7TbuNU=" crossorigin>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
@@ -99,13 +129,21 @@
{% endif %}
{% if page.layout == 'post' %}
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/post.css">
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/syntax.css">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/post.css">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/syntax.css">
{% if site.toc and page.toc %}
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css">
<link rel="preload" as="script" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css" />
<script src="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js" async></script>
<script src="{{ site.baseurl }}/assets/js/dist/toc.min.js" async></script>
{% endif %}
{% endif %}
</head>

View File

@@ -1,5 +1,7 @@
<!--
The Pannel on right side (Desktop views)
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->

View File

@@ -1,6 +1,8 @@
<!--
The related posts of current post.
Placed in the bottom of every single post.
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
Published under the MIT License
-->
@@ -40,21 +42,21 @@
{% if score_list.size > 0 %}
{% assign score_list = score_list | sort | reverse %}
{% assign count = 0 %}
<div id="related-posts" class="mt-4 mb-4 pb-3">
<h3 class="pt-2 mt-1 mb-4" data-toc-skip>Related Posts</h3>
<div id="related-posts" class="mt-4 mb-2 mb-sm-4 pb-2">
<h3 class="pt-2 mt-1 mb-4" data-toc-skip>{{ site.data.label.post.relate_posts }}</h3>
<div class="card-deck mb-4">
{% for score_item in score_list %}
{% assign data = score_item | split: ":" %}
{% assign index = data[1] | plus: 0 %}
{% assign post = site.posts[index] %}
<div class="card">
<a href="{{ post.url }}">
<a href="{{ post.url | relative_url }}">
<div class="card-body">
<span class="timeago small">
{{ post.date | date: POST_DATE }}
<i class="unloaded">{{ post.date | date_to_xmlschema }}</i>
</span>
<h3 class="pt-0 mt-2 mb-3" data-toc-skip>{{ post.title }}</h3>
<h3 class="pt-0 mt-1 mb-3" data-toc-skip>{{ post.title }}</h3>
<div class="text-muted small">
<p>{{ post.content | markdownify | strip_html | truncate: 200 | replace: '&', '&amp;' }}</p>
</div>

View File

@@ -1,5 +1,7 @@
<!--
Jekyll Simple Search loader
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->
@@ -22,8 +24,8 @@
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'),
json: '{{ site.baseurl }}/search.json',
searchResultTemplate: '{{ result_elem }}',
json: '{{ site.baseurl }}/assets/data/search.json',
searchResultTemplate: '{{ result_elem | strip_newlines }}',
noResultsText: '{{ not_found }}'
});
</script>

View File

@@ -1,5 +1,7 @@
<!--
The Search results
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->

View File

@@ -1,5 +1,7 @@
<!--
The Side Bar
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->
@@ -8,11 +10,12 @@
<div id="profile-wrapper" class="d-flex flex-column">
<div id="avatar" class="d-flex justify-content-center">
<a href="{{ site.baseurl }}/" alt="avatar">
{% assign avatar = site.avatar %}
{% if avatar | slice: 0 == '/' %}
{% assign avatar = avatar | prepend: site.baseurl %}
{% assign avatar_url = site.avatar %}
{% capture start %}{{ site.avatar | slice: 0 }}{% endcapture %}
{% if start == '/' %}
{% assign avatar_url = avatar_url | prepend: site.baseurl %}
{% endif %}
<img src="{{ avatar }}">
<img src="{{ avatar_url }}">
</a>
</div>
@@ -20,7 +23,7 @@
<div id="site-title">
<a href="{{ site.baseurl }}/">{{- site.title -}}</a>
</div>
<div id="site-subtitle" class="font-italic">{{ site.description }}</div>
<div id="site-subtitle" class="font-italic">{{- site.tagline -}}</div>
</div>
</div>
@@ -41,7 +44,7 @@
{% if item.url == page_urls.last or
item.name == "Home" and page.layout == "home" %}active{% endif %}">
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
<i class="fa-fw {{ item.icon }} ml-3 mr-4 unloaded"></i>
<i class="fa-fw {{ item.icon }} ml-3 mr-3 unloaded"></i>
<span>{{ item.name | upcase }}</span>
</a>
</li> <!-- .nav-item -->

View File

@@ -1,9 +1,11 @@
<!--
The Top Bar
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
-->
<div id="topbar-wrapper" class="row justify-content-center bg-white 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">
<span id="breadcrumb">
{% for item in page.breadcrumb %}

View File

@@ -1,6 +1,7 @@
<!--
The trending tags list
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT Licensed
-->

View File

@@ -1,7 +1,8 @@
---
layout: page
# The Category layout
# © 2017-2019 Cotes Chung
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# MIT Licensed
---

View File

@@ -1,6 +1,8 @@
---
layout: compress
# Default layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
---
@@ -14,7 +16,7 @@ layout: compress
<div id="sidebar" class="d-flex flex-column">
{% include sidebar.html %}
</div>
<div id="main-wrapper" class="bg-white">
<div id="main-wrapper">
{% include topbar.html %}
<div id="main">

View File

@@ -1,6 +1,8 @@
---
layout: page
# The Home page layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
---

View File

@@ -1,11 +1,13 @@
---
layout: default
# The page layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
<div class="row bg-white">
<div class="row">
<div class="col-12 col-lg-11 col-xl-8">
<div id="page" class="post pb-5 pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 pl-xl-3">
{% if page.dynamic_title %}

View File

@@ -1,6 +1,8 @@
---
layout: default
# The posts' layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
---
@@ -51,7 +53,9 @@ layout: default
{% endif %}
<!-- Add lozad class into image tags. see: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
{% if content contains '<img src=' %}
{{ content | replace: '<img src=', '<img class="lozad" src="/assets/img/commons/loading.png" data-src=' }}
{% capture loading %}{{ "/assets/img/commons/loading.png" | relative_url }}{% endcapture %}
{% assign replacement = '<img class="lozad" src=' | append: loading | append: ' data-src=' %}
{{ content | replace: '<img src=', replacement }}
{% else %}
{{ content }}
{% endif %}
@@ -84,25 +88,25 @@ layout: default
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
{% include related-posts.html %}
<div class="post-pager d-flex justify-content-between">
<div class="post-navigation d-flex justify-content-between">
{% if page.previous.url %}
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary">
<p>{{ page.previous.title }}</p>
{% else %}
<a href="javascript:;" class="btn btn-outline-primary disabled">
<p>-</p>
{% endif %}
<i class="fas fa-angle-left mr-1"></i>
OLDER POST
</a>
{% if page.next.url %}
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary">
<p>{{ page.next.title }}</p>
{% else %}
<a href="javascript:;" class="btn btn-outline-primary disabled">
<p>-</p>
{% endif %}
NEWER POST
<i class="fas fa-angle-right ml-1"></i>
</a>
</div> <!-- div.post-pager -->
</div> <!-- div.post-navigation -->
{% if site.disqus.comments and page.comments %}
{% include disqus.html %}

View File

@@ -1,6 +1,8 @@
---
layout: page
# The layout for Tag page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
---

View File

@@ -58,7 +58,7 @@ Click the hook will locate the footnote[^footnote].
## Image
![Desktop View](/assets/img/sample/mockup.png)
![Desktop View]({{ "/assets/img/sample/mockup.png" | relative_url }})
## Inline code

View File

@@ -24,10 +24,6 @@ tags: [TAG]
> **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.
- **The TimeZone of Date**
To ensure that the posts' release date matches the city you live in, please modify the value of `timezone` in the file `_config.yml`. A list of all available values can be found on [TimezoneConverter](http://www.timezoneconverter.com/cgi-bin/findzone/findzone) or [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
- **Categories and Tags**
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tag` can be zero or infinite.

View File

@@ -7,14 +7,26 @@ tags: [getting started]
## Preparation
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (Ruby, RubyGem, Bundler and Jekyll). In addition, to use the funny script tools, 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/).
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/).
Next, [fork](https://github.com/cotes2020/jekyll-theme-chirpy/fork) **Chirpy** and then clone your replicated repository locally.
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:
* Debian
```console
$ sudo apt-get install coreutils
```
* macOS
```console
$ brew install coreutils
```
## Install Jekyll Plugins
Go to root directory of the repository and run the following:
Go to the root of repo and run:
```terminal
$ bundle install
@@ -34,8 +46,8 @@ jekyll-theme-chirpy/
├── _layouts
├── _posts # posts stay here
├── _scripts
│ └── travis # CI stuff, remove it
├── .travis.yml # remove it, too
── .travis.yml # remove it
├── .github # remove this, too
├── assets
├── tabs
│   └── about.md # the ABOUT page
@@ -45,32 +57,31 @@ jekyll-theme-chirpy/
├── LICENSE
├── README.md
├── _config.yml # configuration file
├── build.sh # script tool
├── run.sh # script tool
├── init.sh # script tool
├── pv.sh
├── tools # script tools
├── feed.xml
├── index.html
├── robots.txt
├── search.json
└── sitemap.xml
```
As mentioned above, some files or directories should be removed from your repo:
- .travis.yml
- .github
## Configuration
Customize the variables in file `_config.yml` as needed.
* Avatar
## Atom Feed
The sample avatar is `/assets/img/sample/avatar.jpg`. It should be replaced by your own one. Notice that a huge image file will increase the load time of your site, so keep your avatar size as samll as possible(may be *<https://tinypng.com/>* will help).
The Atom feed url of your site will be:
* TimeZone
```
<SITE_URL>/feed.xml
```
The `SITE_URL` was defined by variable `url` in file `_config.yml`.
To ensure that the posts' release date matches the city you live in, please modify the field `timezone` correctly. A list of all available values can be found on [TimezoneConverter](http://www.timezoneconverter.com/cgi-bin/findzone/findzone) or [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
## Run Locally
@@ -78,54 +89,79 @@ The `SITE_URL` was defined by variable `url` in file `_config.yml`.
You may want to preview the site before publishing, so just run the script tool:
```terminal
$ bash run.sh
$ bash tools/run.sh
```
>**Note**: The *Recent Update* list requires the latest git-log date of posts, thus make sure the changes in `_posts` have been committed before running this command.
Open a brower and visit <http://localhost:4000>.
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
## Deploying to GitHub Pages
Before the deployment begins, ensure the `url` in `_config.yml` has been set to `https://<username>.github.io`.
Before the deployment begins, ensure the `url` in file `_config.yml` has been set to `https://<username>.github.io`(or the custom domain, if you have. e.g. `https://yourdomain.com`). What's more, if you prefer to the [Project site](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites), change `baseurl` of file `_config.yml` to your project name, starting with a slash. e.g. `/project`.
### Option 1: Built by GitHub Pages
By deploying your site in this way, you can push the source code to GitHub repository directly.
By deploying the site in this way, you're allowed to push the source code directly to the remote.
> **Note**: If you want to add any third-party Jekyll plugins or custom scripts to your project, please refer to [*Option 2: Build locally*](#option-2-build-locally).
> **Note**: If you want to use any third-party Jekyll plugins that not in [this list](https://pages.github.com/versions/), stop reading the current approach and go to [*Option 2: Build locally*](#option-2-build-locally).
**1**. Rename your repository as `<username>.github.io`.
**1**. Rename the repository to:
**2**. Commit the changes of your repository, then run the initialization script:
|Site Type | Repo's Name|
|:---|:---|
|User or Organization | `<username>.github.io`|
|Project| any one except `<username>.github.io`, let's say `project`|
**2**. Commit the changes of the repo first, then run the initialization script:
```console
$ bash init.sh
$ bash tools/init.sh
```
It will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts.
> Please note that the *Recent Update* list requires the latest git-log date of posts, thus make sure the changes in `_posts` have been committed before running this command.
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repository `<username>.github.io`.
it will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts.
**4**. Visit `https://<username>.github.io` and enjoy.
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repo.
**4**. Check it out:
|Site Type | Site URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
### Option 2: Build Locally
For security reasons, GitHub Pages runs on `safe` mode, which means the third-party Jekyll plugins or custom scripts will not work. If you want to use any another third-party Jekyll plugins, **your have to build locally rather than on GitHub Pages**.
For security reasons, GitHub Pages runs on `safe` mode, which means the third-party Jekyll plugins or custom scripts won't work. If you want to use any another plugins that not in the [whitelist](https://pages.github.com/versions/), **you have to generate the site locally rather than on GitHub Pages**.
**1**. On GitHub website, create a brand new repository with name `<username>.github.io` and then clone it locally.
**1**. Browse to GitHub website, create a brand new repo named:
**2**. Build your site by:
|Site Type | Repo's Name|
|:---|:---|
|User or Organization | `<username>.github.io`|
|Project| any one except `<username>.github.io`, let's say `project`|
and clone it.
**2**. In the root of the source project, build your site by:
```console
$ bash build.sh -d /path/to/<username>.github.io/
$ bash tools/build.sh -d /path/to/local/project/
```
The build results will be stored in the root directory of `<username>.github.io` and don't forget to push the changes of `<username>.github.io` to branch `master` on GitHub.
The generated static files will be placed in the root of `/path/to/local/project`. Commit and push the changes to the `master` branch on GitHub.
**3**. Go to GitHub website and enable GitHub Pages service for the new repository `<username>.github.io`.
**3**. Go to GitHub website and enable Pages service for the new repository.
**4**. Visit `https://<username>.github.io` and enjoy.
**4**. Visit at:
|Site Type | Site URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
and enjoy!

View File

@@ -10,11 +10,11 @@ In [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/), the image fi
Whit a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
![upload-image](/assets/img/sample/upload-image.png)
![upload-image]({{ "/assets/img/sample/upload-image.png" | relative_url }})
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
![download-icons](/assets/img/sample/download-icons.png)
![download-icons]({{ "/assets/img/sample/download-icons.png" | relative_url }})
Download the generated package, unzip and delete the following two from the extracted files:
@@ -23,4 +23,4 @@ Download the generated package, unzip and delete the following two from the extr
Now, copy the rest image files (`.PNG` and `.ICO`) to cover the original one in folder `assets/img/favicons/`.
At last, don't forget to rebuild your site so that the icon becomes your custom edition.
Lastly, don't forget to rebuild your site so that the icon becomes your custom edition.

View File

@@ -3,6 +3,8 @@
"""
Automatic invokes all initial scripts for project.
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2018-2019 Cotes Chung
Licensed under MIT
"""

View File

@@ -8,6 +8,8 @@ Dependencies:
- git
- ruamel.yaml
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2018-2019 Cotes Chung
MIT License
'''

View File

@@ -0,0 +1,2 @@
ruamel.yaml==0.16.5
ruamel.yaml.clib==0.1.2

View File

@@ -9,6 +9,8 @@ Dependencies:
- git
- ruamel.yaml
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2018-2019 Cotes Chung
Licensed under MIT
"""

View File

@@ -4,6 +4,8 @@
'''
Common functions to other scripts.
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2018-2019 Cotes Chung
MIT License
'''

View File

@@ -1,7 +1,8 @@
#!/bin/bash
# Files sync monitoer
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT Licensed

View File

@@ -1,36 +0,0 @@
#!/bin/bash
# Travis CI build jobs.
#
# © 2019 Cotes Chung
# Published under MIT License
if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then # triggered by author
BUILDER=../blog-builder
git clone https://${GH_TOKEN}@github.com/cotes2020/blog-builder.git \
$BUILDER --depth=1 -q
cp -r $BUILDER/framework/* .
bash _cibuild.sh
else # triggered by Pull Request
SAFE_DOMAIN="cdn.jsdelivr.net"
python _scripts/py/init_all.py
build_cmd="bundle exec jekyll build"
echo "\$ $build_cmd"
eval $build_cmd
bundle exec htmlproofer _site/ \
--disable-external \
--check-html \
--empty_alt_ignore \
--allow_hash_href \
--url_ignore $SAFE_DOMAIN
fi

View File

@@ -0,0 +1,60 @@
/*!
* The main dark mode styles
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT Licensed
*/
@media (prefers-color-scheme: dark) {
html {
/* framework */
--main-wrapper-bg: rgb(27, 27, 30);
--topbar-wrapper-bg: rgb(39, 40, 43);
--search-wrapper-bg: rgb(34, 34, 39);
--search-icon: rgb(100, 102, 105);
--input-focus-border: rgb(112, 114, 115);
--footer-bg: rgb(31, 30, 30);
--footer-border: rgb(44, 45, 45);
--mask-bg: rgb(68, 69, 70);
/* sidebar */
--nav-cursor: rgb(183, 182, 182);
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
/* common color */
--text-color: rgb(175, 176, 177);
--text-muted-color: rgb(107, 116, 124);
--link-color: rgb(138, 180, 248);
--link-underline-color: rgb(99, 131, 182);
--main-border: rgb(63, 65, 68);
--button-bg: rgb(39, 40, 33);
--blockquote-border: rgb(66, 66, 66);
--blockquote-text: rgb(117, 117, 117);
--card-bg: rgb(39, 40, 33);
--card-header-bg: rgb(51, 50, 50);
--relate-post-title: rgb(164, 175, 181);
/* Home page */
--btn-active-bg: #1c345e;
--btn-active-border-color: #8ab4f8;
/* posts */
--toc-highlight: rgb(116, 178, 243);
--tag-bg: rgb(41, 40, 40);
--tag-hover: rgb(43, 56, 62);
--tb-odd-bg: rgba(52, 53, 42, 0.52); /* odd rows of the posts' table */
--tb-even-bg: rgb(31, 31, 34); /* even rows of the posts' table */
/* tags */
--tag-border: rgb(59, 79, 88);
--tag-shadow: rgb(32, 33, 33);
/* categories */
--categories-hover-bg: rgb(73, 75, 76);
/* archives */
--timeline-node-bg: rgb(150, 152, 156);
}
}

View File

@@ -0,0 +1,89 @@
/*!
* The syntax dark mode styles
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT Licensed
*/
@media (prefers-color-scheme: dark) {
html {
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
--highlight-pre-bg: #272822;
--highlight-hll-bg: #272822;
--highlight-c: #75715e; /* Comment */
--highlight-err: #960050; /* Error */
--highlight-err-bg: #1e0010; /* Error background */
--highlight-k: #66d9ef; /* Keyword */
--highlight-l: #ae81ff; /* Literal */
--highlight-n: #f8f8f2; /* Name */
--highlight-o: #f92672; /* Operator */
--highlight-p: #f8f8f2; /* Punctuation */
--highlight-cm: #75715e; /* Comment.Multiline */
--highlight-cp: #75715e; /* Comment.Preproc */
--highlight-c1: #75715e; /* Comment.Single */
--highlight-cs: #75715e; /* Comment.Special */
--highlight-kc: #66d9ef; /* Keyword.Constant */
--highlight-kd: #66d9ef; /* Keyword.Declaration */
--highlight-kn: #f92672; /* Keyword.Namespace */
--highlight-kp: #66d9ef; /* Keyword.Pseudo */
--highlight-kr: #66d9ef; /* Keyword.Reserved */
--highlight-kt: #66d9ef; /* Keyword.Type */
--highlight-ld: #e6db74; /* Literal.Date */
--highlight-m: #ae81ff; /* Literal.Number */
--highlight-s: #e6db74; /* Literal.String */
--highlight-na: #a6e22e; /* Name.Attribute */
--highlight-nb: #f8f8f2; /* Name.Builtin */
--highlight-nc: #a6e22e; /* Name.Class */
--highlight-no: #66d9ef; /* Name.Constant */
--highlight-nd: #a6e22e; /* Name.Decorator */
--highlight-ni: #f8f8f2; /* Name.Entity */
--highlight-ne: #a6e22e; /* Name.Exception */
--highlight-nf: #a6e22e; /* Name.Function */
--highlight-nl: #f8f8f2; /* Name.Label */
--highlight-nn: #f8f8f2; /* Name.Namespace */
--highlight-nx: #a6e22e; /* Name.Other */
--highlight-py: #f8f8f2; /* Name.Property */
--highlight-nt: #f92672; /* Name.Tag */
--highlight-nv: #f8f8f2; /* Name.Variable */
--highlight-ow: #f92672; /* Operator.Word */
--highlight-w: #f8f8f2; /* Text.Whitespace */
--highlight-mf: #ae81ff; /* Literal.Number.Float */
--highlight-mh: #ae81ff; /* Literal.Number.Hex */
--highlight-mi: #ae81ff; /* Literal.Number.Integer */
--highlight-mo: #ae81ff; /* Literal.Number.Oct */
--highlight-sb: #e6db74; /* Literal.String.Backtick */
--highlight-sc: #e6db74; /* Literal.String.Char */
--highlight-sd: #e6db74; /* Literal.String.Doc */
--highlight-s2: #e6db74; /* Literal.String.Double */
--highlight-se: #ae81ff; /* Literal.String.Escape */
--highlight-sh: #e6db74; /* Literal.String.Heredoc */
--highlight-si: #e6db74; /* Literal.String.Interpol */
--highlight-sx: #e6db74; /* Literal.String.Other */
--highlight-sr: #e6db74; /* Literal.String.Regex */
--highlight-s1: #e6db74; /* Literal.String.Single */
--highlight-ss: #e6db74; /* Literal.String.Symbol */
--highlight-bp: #f8f8f2; /* Name.Builtin.Pseudo */
--highlight-vc: #f8f8f2; /* Name.Variable.Class */
--highlight-vg: #f8f8f2; /* Name.Variable.Global */
--highlight-vi: #f8f8f2; /* Name.Variable.Instance */
--highlight-il: #ae81ff; /* Literal.Number.Integer.Long */
// --highlight-gh: none; /* Generic Heading & Diff Header */
--highlight-gu: #75715e; /* Generic.Subheading & Diff Unified/Comment? */
--highlight-gd: #f92672; /* Generic.Deleted & Diff Deleted */
/* My styles */
--highlight-lineno: #6c6c6d;
--highlight-lineno-border: #3c4042;
}
pre {
color: #818c96; /* override Bootstrap */
}
kbd {
background-color: black;
}
}

View File

@@ -2,6 +2,8 @@
---
/*!
Style for Archives
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
*/
@@ -16,7 +18,7 @@
}
#archives li:nth-child(odd) {
background-color: #fff;
background-color: var(--main-wrapper-bg, #fff);
background-image: linear-gradient(to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
}
@@ -54,8 +56,8 @@
top: -26px;
left: 63px;
border: 3px solid;
background-color: #ffffff;
border-color: #c2c6cc;
background-color: var(--main-border, #ffffff);
border-color: var(--timeline-node-bg, #c2c6cc);
box-shadow: 0 0 2px 0 #c2c6cc;
z-index: 1;
}
@@ -101,7 +103,7 @@
float: left;
top: 1.35rem;
left: 69px;
background-color: #c2c6cc;
background-color: var(--timeline-node-bg, #c2c6cc);
box-shadow: 0 0 3px 0 #c2c6cc;
z-index: 1;
}
@@ -115,7 +117,7 @@
display: inline-block;
float: left;
position: relative;
background-color: rgba(0, 0, 0, 0.075);
background-color: var(--main-border, rgba(0, 0, 0, 0.075));
}
#archives ul>li::after {
@@ -137,7 +139,6 @@
}
@media all and (max-width: 576px) {
#archives {
margin-top: -1rem;
}
@@ -146,3 +147,10 @@
letter-spacing: 0;
}
}
@media (prefers-color-scheme: dark) {
#archives li:nth-child(odd) {
background-image: linear-gradient(to left,
rgb(26, 26, 30), rgb(39, 39, 45), rgb(39, 39, 45), rgb(39, 39, 45), rgb(26, 26, 30));
}
}

View File

@@ -2,6 +2,8 @@
---
/*!
Style for Tab Categories
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
*/
@@ -46,7 +48,7 @@
@media (hover: hover) { // only works on desktop
.category-trigger:hover {
background-color: #e9ecef;
background-color: var(--categories-hover-bg, #e9ecef);
}
}
@@ -62,3 +64,25 @@
-webkit-transform: rotate(-90deg); /* Safari 3-8 */
transform: rotate(-90deg);
}
@media (prefers-color-scheme: dark) {
.categories.card,
.list-group-item {
background-color: var(--card-bg);
}
.categories .card-header {
background-color: var(--card-header-bg);
}
.categories .list-group-item {
border-left: none;
border-right: none;
padding-left: 2rem;
border-color: var(--main-border);
}
.categories .list-group-item:last-child {
border-bottom-color: var(--card-bg);
}
}

View File

@@ -2,6 +2,8 @@
---
/*!
Style for page Category and Tag
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
*/
@@ -51,7 +53,7 @@
.dash {
margin: 0 .5rem .6rem .5rem;
border-bottom: 2px dotted silver;
border-bottom: 2px dotted var(--main-border, silver);
}
@media all and (max-width: 576px) {

View File

@@ -3,6 +3,8 @@
/*!
Style for Homepage
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
*/
@@ -39,7 +41,7 @@
.post-preview .post-content {
margin-top: .6rem;
margin-bottom: .6rem;
color: dimgray;
color: var(--text-color, dimgray);
}
/* Make preview shorter in Home page*/
@@ -53,7 +55,7 @@
}
.page-item .page-link {
color: #555555;
color: var(--text-color, #555555);
width: 2.5rem;
height: 2.5rem;
padding: 0;
@@ -65,19 +67,22 @@
-webkit-box-align: center;
align-items: center;
border-radius: 50%;
border: 1px solid #f1f1f1;
border: 1px solid var(--main-border, #f1f1f1);
font-family: 'Lato', sans-serif;
background-color: var(--button-bg);
}
.page-item.active .page-link {
background-color: #2a408e;
box-shadow: 0 0 8px 0 #4b92d2 !important;
color: #f8f8f8;
background-color: var(--btn-active-bg, #2a408e);
border-color: var(--btn-active-border-color, #007bff);
box-shadow: 0 0 8px 0 var(--main-wrapper-bg, #4b92d2) !important;
color: var(--text-color, #f8f8f8);
}
.page-item.disabled .page-link {
color: rgba(108, 117, 125, 0.57);
border-color: #f1f1f1;
border-color: var(--main-border, #f1f1f1);
background-color: var(--button-bg);
}
.page-item.disabled {

View File

@@ -2,11 +2,14 @@
---
/*!
* The main styles.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT Licensed
*/
@import "_fonts";
@import "_dark/dark-main";
html, body {
height: 100%;
@@ -20,8 +23,8 @@ html {
body {
line-height: 1.75rem;
background: #fafafa;
color: #212529;
background: var(--main-wrapper-bg, #fafafa);
color: var(--text-color, #212529);
-webkit-font-smoothing: antialiased;
font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif;
}
@@ -41,7 +44,8 @@ body {
-webkit-transition: transform 0.4s ease;
transition: transform 0.4s ease;
background: rgb(42, 30, 107);
background: radial-gradient(circle, rgba(42, 30, 107, 1) 0%, rgba(35, 37, 46, 1) 100%);
background: var(--sidebar-bg,
radial-gradient(circle, rgba(42, 30, 107, 1) 0%, rgba(35, 37, 46, 1) 100%));
}
#sidebar a {
@@ -120,7 +124,7 @@ body {
position: relative;
width: 3px;
height: 26px;
background: #fcfcfc;;
background-color: var(--nav-cursor, #fcfcfc);
pointer-events: none;
}
@@ -243,6 +247,7 @@ body {
z-index: 50;
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.05);
background-color: var(--topbar-wrapper-bg, white);
}
#topbar i { // icons
@@ -269,8 +274,8 @@ body {
display: flex;
width: 95%;
border-radius: 1rem;
border: 1px solid #fff;
background: #f5f5f5;
border: 1px solid var(--search-wrapper-bg, #fff);
background: var(--search-wrapper-bg, #f5f5f5);
padding: 0 .5rem;
transition: background-color .15s ease-in-out,border-color .15s ease-in-out;
}
@@ -278,7 +283,7 @@ body {
#search-wrapper i {
z-index: 2;
font-size: .9rem;
color: #c2c6cc;
color: var(--search-icon, #c2c6cc);
}
#search-wrapper .fa-times-circle { /* button 'clean up' */
@@ -286,7 +291,7 @@ body {
}
#search-wrapper+a { /* 'Cancel' link */
color: #2a408e;
color: var(--link-color, #2a408e);
margin-left: 1rem;
display: none;
}
@@ -296,6 +301,7 @@ body {
border: 0;
border-radius: 0;
padding: .18rem .3rem;
color: var(--text-color);
}
#search-input:focus {
@@ -316,7 +322,7 @@ body {
display: inline-block;
line-height: 1rem;
font-size: 1rem;
background: #f8f9fa;
background: var(--tag-bg, #f8f9fa);
border: none;
padding: .5rem;
margin: 0 1rem 1rem 0;
@@ -364,7 +370,7 @@ body {
font-size: 1.1rem;
font-weight: 600;
font-family: sans-serif;
color: rgb(78, 78, 78);
color: var(--text-color, rgb(78, 78, 78));
text-align: center;
width: 70%;
overflow: hidden;
@@ -382,7 +388,7 @@ body {
left: 0;
height: 100%;
width: 100%;
background: #c1c3c5;
background: var(--mask-bg, #c1c3c5);
opacity: 0.5;
z-index: 1;
}
@@ -394,6 +400,7 @@ body {
/*--- main wrapper ---*/
#main-wrapper {
background-color: var(--main-wrapper-bg, white);//rgb(27, 27, 30);
position: relative;
min-height: 100%;
padding-bottom: 6rem; /* equals to or greatter than footer's height */
@@ -433,7 +440,8 @@ footer {
padding: 1rem;
font-size: 0.8rem;
color: #7a7b7d;
background: #f3f3f3;
background-color: var(--footer-bg, #f3f3f3);
border-top: 1px solid var(--footer-border, #f3f3f3);
}
footer>div.d-flex {
@@ -510,7 +518,7 @@ footer .license a {
line-height: 1rem;
font-size: 0.85rem;
background: none;
border: 1px solid #e9ecef;
border: 1px solid var(--main-border, #e9ecef);
border-radius: .8rem;
padding: .3rem .5rem;
margin: 0 .35rem .5rem 0;
@@ -544,12 +552,12 @@ footer .license a {
z-index: 1;
cursor: pointer;
position: fixed;
background: #fff;
color: #686868;
background: var(--button-bg, #fff);
color: var(--text-color, #686868);
height: 2.6em;
width: 2.7em;
border-radius: 50%;
border: 1px solid #f1f1f1;
border: 1px solid var(--main-border, #f1f1f1);
transition: 0.2s ease-out;
-webkit-transition: 0.2s ease-out;
}
@@ -589,13 +597,13 @@ h2, h3, h4 {
}
blockquote {
border-left: 5px solid #eee;
border-left: 5px solid var(--blockquote-border, #eee);
padding-left: 1rem;
color: #9a9a9a;
color: var(--blockquote-text, #9a9a9a);
}
.post-content blockquote a {
color: #2a408e;
color: var(--link-color, #2a408e);
}
kbd {
@@ -653,8 +661,8 @@ a.reversefootnote {
}
.post-content a {
color: #2a408e;
border-bottom: 1px dotted #c2c6cc;
color: var(--link-color, #2a408e);
border-bottom: 1px dotted var(--link-underline-color, #c2c6cc);
}
p>a, span>a,
@@ -665,7 +673,7 @@ p>a, span>a,
#page-tag a,
#archives a,
#search-results a {
color: #2a408e;
color: var(--link-color, #2a408e);
}
.categories a,
@@ -714,12 +722,16 @@ table thead {
border-bottom: solid 2px rgba(210, 215, 217, 0.75);
}
table thead+tbody tr {
border-bottom: solid 1px rgba(210, 215, 217, 0.75);
table thead+tbody tr:nth-child(2n) {
background-color: var(--tb-even-bg);
}
table thead+tbody tr:last-child:nth-child(2n) {
border-bottom: solid 1px var(--tb-odd-bg, rgba(210, 215, 217, 0.75));
}
table thead+tbody tr:nth-child(2n + 1) {
background-color: #f8f9fa;
background-color: var(--tb-odd-bg, #f8f9fa);
}
table thead th,
@@ -740,8 +752,8 @@ table tbody td {
}
.post-meta a {
color: #2a408e;
border-bottom: 1px dotted #c2c6cc;
color: var(--link-color, #2a408e);
border-bottom: 1px dotted var(--link-underline-color, #c2c6cc);
}
.post-meta a:not(:last-child) {
@@ -760,7 +772,7 @@ table tbody td {
display: inline-block;
min-width: 2rem;
text-align: center;
background: rgba(0, 0, 0, 0.075);
background: var(--tag-bg, rgba(0, 0, 0, 0.075));
border-radius: .34rem;
padding: 0 .4rem;
margin: 0 .1rem;
@@ -770,7 +782,7 @@ table tbody td {
.tag:hover,
.post-tag:hover {
background: rgb(222, 226, 230);
background: var(--tag-hover, rgb(222, 226, 230));
transition: background 0.35s ease-in-out;
}
@@ -813,7 +825,7 @@ table tbody td {
}
.btn-box-shadow {
box-shadow: 0 0 8px 0 #eaeaea!important;
box-shadow: 0 0 8px 0 var(--main-wrapper-bg, #eaeaea) !important;
}
.topbar-up {
@@ -841,7 +853,7 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
.input-focus {
box-shadow: none;
border-color: #e9ecef !important;
border-color: var(--input-focus-border, #e9ecef) !important;
background: center !important;
}
@@ -910,6 +922,11 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
/* Sidebar is visibal */
@media all and (min-width: 831px) {
#profile-wrapper {
margin-top: 3rem;
}
#search-wrapper {
width: 22%;
min-width: 150px;
@@ -1241,24 +1258,30 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
width: 350px;
}
#sidebar ul {
margin-left: 5%;
}
#profile-wrapper {
margin-top: 4rem;
margin-bottom: 5rem;
margin-bottom: 3rem;
padding-left: 18%;
-ms-flex-direction: column!important;
flex-direction: row!important;
}
#avatar {
margin-left: 2.5rem;
-webkit-box-pack: normal !important;
-ms-flex-pack: normal !important;
justify-content: normal !important;
}
#avatar > a {
width: 5rem;
height: 5rem;
width: 6.2rem;
height: 6.2rem;
}
.profile-text {
margin-top: 0!important;
padding-left: .5rem;
/* .d-flex */
display: -webkit-box!important;
display: -ms-flexbox!important;
@@ -1272,18 +1295,19 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
}
#site-title a {
text-transform: uppercase;
font-size: 1.7rem;
letter-spacing: 1px;
}
.profile-text>div {
text-align: left !important;
margin-left: .8rem !important;
width: 100%;
}
#site-subtitle {
word-spacing: 0;
margin-top: .3rem;
margin-bottom: 0;
padding-right: 3rem;
margin: .3rem 0 0 0;
}
#sidebar ul>li>a {
@@ -1309,7 +1333,7 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
}
.contact {
margin-left: 2.5rem;
margin-left: 3.5rem;
margin-right: 4.5rem;
font-size: 1.3rem;
padding-bottom: 1rem;

View File

@@ -2,6 +2,8 @@
---
/*!
Individual styles for Post
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
*/
@@ -11,36 +13,82 @@
margin-bottom: 1.5rem;
max-width: 100%;
height: auto;
filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.08));
// filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.08));
position: relative;
left: 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
.post-tail {
margin-top: 3.5rem;
border-bottom: 1px double #e9ecef;
border-bottom: 1px double var(--main-border, #e9ecef);
font-size: 0.85rem;
}
.post-pager {
margin: 1rem 0 2rem;
.post-navigation {
padding: 1rem .2rem;
margin-bottom: 2rem;
}
.post-pager .btn,
.post-pager .btn.disabled {
color: #2a408e;
.post-navigation .btn,
.post-navigation .btn.disabled {
width: 50%;
position: relative;
color: var(--link-color, #2a408e);
border-color: var(--main-border, #e9ecef);
}
.post-navigation .btn:hover {
background: #2a408e;
color: #fff;
border-color: #2a408e;
}
.post-pager .btn:hover {
background: #2a408e;
color: #fff;
}
.post-pager a.btn.disabled {
.post-navigation a.btn.disabled {
pointer-events: auto;
cursor: not-allowed;
background: none;
color: gray;
border-color: gray;
border-color: var(--main-border, #e9ecef);
}
.post-navigation a.btn.btn-outline-primary.disabled:focus {
box-shadow: none;
}
.post-navigation a > p {
font-size: 1.1rem;
line-height: 1.5rem;
margin-top: .3rem;
white-space: normal;
}
.post-navigation a:first-child {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
left: .5px;
}
.post-navigation a:last-child {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
right: .5px;
}
.post-navigation a::before {
color: var(--text-muted-color, gray);
font-size: .65rem;
text-transform: uppercase;
}
.post-navigation a:first-child::before {
content: "Older";
}
.post-navigation a:last-child::before {
content: "Newer";
}
@keyframes fade-up {
@@ -76,16 +124,14 @@
}
#toc li>a {
padding-top: 0;
line-height: 1rem;
padding-top: .5rem;
padding-bottom: .5rem;
}
/*--- Related Posts ---*/
#related-posts {
border-bottom: 1px double #e9ecef;
}
#related-posts > h3 {
color: gray;
font-size: 1.1rem;
@@ -93,24 +139,26 @@
}
#related-posts .card {
border: 1px solid #f1f1f1;
box-shadow: 0 0 5px 0 rgba(234, 234, 234, 0.7686274509803922);
border: 1px solid var(--main-wrapper-bg, #f1f1f1);
background-color: var(--card-bg);
box-shadow: 0 0 5px 0 var(--main-wrapper-bg, rgba(234, 234, 234, 0.7686274509803922));
-webkit-transition: all .3s ease-in-out;;
-moz-transition: all .3s ease-in-out;;
transition: all .3s ease-in-out;
}
#related-posts .card:hover {
-webkit-transform: translate3d(0, -8px, 0);
transform: translate3d(0, -8px, 0);
-webkit-transform: translate3d(0, -3px, 0);
transform: translate3d(0, -3px, 0);
filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.08));
}
#related-posts .card h3 {
color: #353a3d;
color: var(--relate-post-title, #353a3d);
}
#related-posts .timeago {
color: rgba(30,55,70,.4);
color: var(--text-muted-color, rgba(30,55,70,.4));
}
#related-posts p {
@@ -148,7 +196,6 @@
min-height: 2rem;
}
@media all and (max-width: 768px) {
.post img {
max-width: calc(100% + 1rem);
@@ -187,6 +234,13 @@
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
.post-navigation {
padding-left: 0;
padding-right: 0;
margin-left: -.5rem;
margin-right: -.5rem;
}
}
/*
@@ -215,3 +269,15 @@
margin-right: calc((100% - 1150px) / 8 + 300px);
}
}
@media (prefers-color-scheme: dark) {
nav[data-toggle=toc] .nav-link.active,
nav[data-toggle=toc] .nav-link.active:focus,
nav[data-toggle=toc] .nav-link.active:hover,
nav[data-toggle=toc] .nav>li>a:focus,
nav[data-toggle=toc] .nav>li>a:hover {
/* Override BS */
color: var(--toc-highlight)!important;
border-left-color: var(--toc-highlight)!important;
}
}

View File

@@ -2,85 +2,89 @@
---
/*
* The syntax highlight.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT Licensed
*/
.highlight .hll { background-color: #ffc; }
.highlight .c { color: #999; } /* Comment */
.highlight .err { color: #a00; background-color: #faa } /* Error */
.highlight .k { color: #069; } /* Keyword */
.highlight .o { color: #555 } /* Operator */
.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #099 } /* Comment.Preproc */
.highlight .c1 { color: #999; } /* Comment.Single */
.highlight .cs { color: #999; } /* Comment.Special */
.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #f00 } /* Generic.Error */
.highlight .gh { color: #030; } /* Generic.Heading */
.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */
.highlight .go { color: #aaa } /* Generic.Output */
.highlight .gp { color: #009; } /* Generic.Prompt */
.highlight .gs { } /* Generic.Strong */
.highlight .gu { color: #030; } /* Generic.Subheading */
.highlight .gt { color: #9c6 } /* Generic.Traceback */
.highlight .kc { color: #069; } /* Keyword.Constant */
.highlight .kd { color: #069; } /* Keyword.Declaration */
.highlight .kn { color: #069; } /* Keyword.Namespace */
.highlight .kp { color: #069 } /* Keyword.Pseudo */
.highlight .kr { color: #069; } /* Keyword.Reserved */
.highlight .kt { color: #078; } /* Keyword.Type */
.highlight .m { color: #f60 } /* Literal.Number */
.highlight .s { color: #d44950 } /* Literal.String */
.highlight .na { color: #4f9fcf } /* Name.Attribute */
.highlight .nb { color: #366 } /* Name.Builtin */
.highlight .nc { color: #0a8; } /* Name.Class */
.highlight .no { color: #360 } /* Name.Constant */
.highlight .nd { color: #99f } /* Name.Decorator */
.highlight .ni { color: #999; } /* Name.Entity */
.highlight .ne { color: #c00; } /* Name.Exception */
.highlight .nf { color: #c0f } /* Name.Function */
.highlight .nl { color: #99f } /* Name.Label */
.highlight .nn { color: #0cf; } /* Name.Namespace */
.highlight .nt { color: #2f6f9f; } /* Name.Tag */
.highlight .nv { color: #033 } /* Name.Variable */
.highlight .ow { color: #000; } /* Operator.Word */
.highlight .w { color: #bbb } /* Text.Whitespace */
.highlight .mf { color: #f60 } /* Literal.Number.Float */
.highlight .mh { color: #f60 } /* Literal.Number.Hex */
.highlight .mi { color: #f60 } /* Literal.Number.Integer */
.highlight .mo { color: #f60 } /* Literal.Number.Oct */
.highlight .sb { color: #c30 } /* Literal.String.Backtick */
.highlight .sc { color: #c30 } /* Literal.String.Char */
.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #c30 } /* Literal.String.Double */
.highlight .se { color: #c30; } /* Literal.String.Escape */
.highlight .sh { color: #c30 } /* Literal.String.Heredoc */
.highlight .si { color: #a00 } /* Literal.String.Interpol */
.highlight .sx { color: #c30 } /* Literal.String.Other */
.highlight .sr { color: #3aa } /* Literal.String.Regex */
.highlight .s1 { color: #c30 } /* Literal.String.Single */
.highlight .ss { color: #fc3 } /* Literal.String.Symbol */
.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #033 } /* Name.Variable.Class */
.highlight .vg { color: #033 } /* Name.Variable.Global */
.highlight .vi { color: #033 } /* Name.Variable.Instance */
.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */
@import "_dark/dark-syntax";
/* the fallback color from https://raw.githubusercontent.com/jwarby/pygments-css/master/github.css */
.highlight pre { background-color: var(--highlight-pre-bg) }
.highlight .hll { background-color: var(--highlight-hll-bg, #ffffcc) }
.highlight .c { color: var(--highlight-c, #999988); font-style: italic } /* Comment */
.highlight .err { color: var(--highlight-err, #a61717); background-color: var(--highlight-err-bg, #e3d2d2) } /* Error */
.highlight .k { color: var(--highlight-k, #000000); font-weight: bold } /* Keyword */
.highlight .o { color: var(--highlight-o, #000000); font-weight: bold } /* Operator */
.highlight .cm { color: var(--highlight-cm, #999988); font-style: italic } /* Comment.Multiline */
.highlight .cp { color: var(--highlight-cp, #999999); font-weight: bold; font-style: italic } /* Comment.Preproc */
.highlight .c1 { color: var(--highlight-c1, #999988); font-style: italic } /* Comment.Single */
.highlight .cs { color: var(--highlight-cs, #999999); font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: var(--highlight-gd, #000000); background-color: var(#ffdddd) } /* Generic.Deleted */
.highlight .ge { color: var(--highlight-ge, #000000); font-style: italic } /* Generic.Emph */
.highlight .gr { color: var(--highlight-gr, #aa0000) } /* Generic.Error */
.highlight .gh { color: var(--highlight-gh, #999999) } /* Generic.Heading */
.highlight .gi { color: var(--highlight-gi, #000000); background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: var(#888888) } /* Generic.Output */
.highlight .gp { color: var(#555555) } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: var(--highlight-gu, #aaaaaa) } /* Generic.Subheading */
.highlight .gt { color: var(--highlight-gt, #aa0000) } /* Generic.Traceback */
.highlight .kc { color: var(--highlight-kc, #000000); font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: var(--highlight-kd, #000000); font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: var(--highlight-kn, #000000); font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: var(--highlight-kp, #000000); font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { color: var(--highlight-kr, #000000); font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: var(--highlight-kt, #445588); font-weight: bold } /* Keyword.Type */
.highlight .m { color: var(--highlight-m, #009999) } /* Literal.Number */
.highlight .s { color: var(--highlight-s, #d01040) } /* Literal.String */
.highlight .na { color: var(--highlight-na, #008080) } /* Name.Attribute */
.highlight .nb { color: var(--highlight-nb, #0086B3) } /* Name.Builtin */
.highlight .nc { color: var(--highlight-nc, #445588); font-weight: bold } /* Name.Class */
.highlight .no { color: var(--highlight-no, #008080) } /* Name.Constant */
.highlight .nd { color: var(--highlight-nd, #3c5d5d); font-weight: bold } /* Name.Decorator */
.highlight .ni { color: var(--highlight-ni, #800080) } /* Name.Entity */
.highlight .ne { color: var(--highlight-ne, #990000); font-weight: bold } /* Name.Exception */
.highlight .nf { color: var(--highlight-nf, #990000); font-weight: bold } /* Name.Function */
.highlight .nl { color: var(--highlight-nl, #990000); font-weight: bold } /* Name.Label */
.highlight .nn { color: var(--highlight-nn, #555555) } /* Name.Namespace */
.highlight .nt { color: var(--highlight-nt, #000080) } /* Name.Tag */
.highlight .nv { color: var(--highlight-nv, #008080) } /* Name.Variable */
.highlight .ow { color: var(--highlight-ow, #000000); font-weight: bold } /* Operator.Word */
.highlight .w { color: var(--highlight-w, #bbbbbb) } /* Text.Whitespace */
.highlight .mf { color: var(--highlight-mf, #009999) } /* Literal.Number.Float */
.highlight .mh { color: var(--highlight-mh, #009999) } /* Literal.Number.Hex */
.highlight .mi { color: var(--highlight-mi, #009999) } /* Literal.Number.Integer */
.highlight .mo { color: var(--highlight-mo, #009999) } /* Literal.Number.Oct */
.highlight .sb { color: var(--highlight-sb, #d01040) } /* Literal.String.Backtick */
.highlight .sc { color: var(--highlight-sc, #d01040) } /* Literal.String.Char */
.highlight .sd { color: var(--highlight-sd, #d01040) } /* Literal.String.Doc */
.highlight .s2 { color: var(--highlight-s2, #d01040) } /* Literal.String.Double */
.highlight .se { color: var(--highlight-se, #d01040) } /* Literal.String.Escape */
.highlight .sh { color: var(--highlight-sh, #d01040) } /* Literal.String.Heredoc */
.highlight .si { color: var(--highlight-si, #d01040) } /* Literal.String.Interpol */
.highlight .sx { color: var(--highlight-sx, #d01040) } /* Literal.String.Other */
.highlight .sr { color: var(--highlight-sr, #009926) } /* Literal.String.Regex */
.highlight .s1 { color: var(--highlight-s1, #d01040) } /* Literal.String.Single */
.highlight .ss { color: var(--highlight-ss, #990073) } /* Literal.String.Symbol */
.highlight .bp { color: var(--highlight-bp, #999999) } /* Name.Builtin.Pseudo */
.highlight .vc { color: var(--highlight-vc, #008080) } /* Name.Variable.Class */
.highlight .vg { color: var(--highlight-vg, #008080) } /* Name.Variable.Global */
.highlight .vi { color: var(--highlight-vi, #008080) } /* Name.Variable.Instance */
.highlight .il { color: var(--highlight-il, #009999) } /* Literal.Number.Integer.Long */
/*-- Codes Snippet --*/
div.highlight,
figure.highlight,
.highlighter-rouge {
background: #f7f7f7;
background: var(--highlight-pre-bg, #f7f7f7)
}
.highlight {
overflow: auto;
-moz-box-shadow: inset 0 0 2px #c2c6cc;
-webkit-box-shadow: inset 0 0 2px #c2c6cc;
box-shadow: inset 0 0 2px #c2c6cc;
}
.highlight .lineno {
@@ -88,8 +92,8 @@ figure.highlight,
padding: 0 .5rem;
min-width: 2.2rem;
text-align: right;
color: #c2c6cc;
border-right: 1px solid #e9ecef;
color: var(--highlight-lineno, #c2c6cc);
border-right: 1px solid var(--highlight-lineno-border, #e9ecef);
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
@@ -121,7 +125,6 @@ figure.highlight,
/* Override BS Inline-code style */
.highlighter-rouge {
color: black;
margin-bottom: 1.2em;
}
@@ -136,7 +139,6 @@ code.highlighter-rouge {
padding: 2px 4px;
margin: 0 .3rem;
border-radius: 4px;
border: 1px solid #e9ecef;
}
td.rouge-code {
@@ -162,3 +164,19 @@ div.language-console.highlighter-rouge td.rouge-code,
div.language-terminal.highlighter-rouge td.rouge-code {
padding: .8rem 1rem;
}
@media (prefers-color-scheme: light) {
.highlight {
-moz-box-shadow: inset 0 0 2px #c2c6cc;
-webkit-box-shadow: inset 0 0 2px #c2c6cc;
box-shadow: inset 0 0 2px #c2c6cc;
}
.highlighter-rouge {
color: black;
}
code.highlighter-rouge {
border: 1px solid #e9ecef;
}
}

View File

@@ -2,9 +2,11 @@
---
/*!
Styles for Tab Tags
© 2019 Cotes Chung
MIT License
* Styles for Tab Tags
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT License
*/
.tag {
@@ -13,8 +15,8 @@
margin-right: .8rem;
line-height: 3rem;
letter-spacing: 0;
border: 1px solid #dee2e6 !important;
box-shadow: 0 0 3px 0 #e9ecef;
border: 1px solid var(--tag-border, #dee2e6) !important;
box-shadow: 0 0 3px 0 var(--tag-shadow, #e9ecef);
}
.tag span {

View File

@@ -1,4 +1,6 @@
---
---
{"proxyUrl":"{{ site.google_analytics.proxy_url }}"}
{
"proxyUrl": "{{ site.google_analytics.proxy_url }}"
}

View File

@@ -1,5 +1,4 @@
---
layout: compress
---
[

View File

@@ -1,8 +1,11 @@
---
layout: compress
# A part of the Favicons
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT License
layout: compress
---
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>

View File

@@ -1,8 +1,11 @@
---
layout: compress
# A part of the Favicons
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT License
layout: compress
---
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 230 KiB

View File

@@ -1,5 +1,7 @@
/*
* This script make #search-result-wrapper switch to unloaded or shown automatically.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/

View File

@@ -1,5 +1,7 @@
/**
* Expand or close the sidebar in mobile screens.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/

View File

@@ -1,5 +1,7 @@
/**
* Initial Bootstrap Tooltip.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT License
*/

View File

@@ -1,5 +1,7 @@
/*
* Hide Header on scroll down
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/

View File

@@ -1,5 +1,7 @@
/*
* Topbar title auto change while scrolling in mobile screens.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/

View File

@@ -1,5 +1,7 @@
/*
* Tab 'Categories' expand/close effect.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/

View File

@@ -5,6 +5,8 @@
* - jQuery
* - countUp.js(https://github.com/inorganik/countUp.js)
*
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/

View File

@@ -1,6 +1,7 @@
/*
* Caculate the Timeago
*
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT Licensed
*/

View File

@@ -1,6 +1,7 @@
/*
* Hide the empty ToC in posts.
*
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT Licensed
*/

109
build.sh
View File

@@ -1,109 +0,0 @@
#!/bin/bash
#
# Build jekyll site and store site files in ./_site
# © 2019 Cotes Chung
# Published under MIT License
CMD="JEKYLL_ENV=production bundle exec jekyll b"
DEST=$(realpath '_site')
help() {
echo "Usage:"
echo
echo " bash build.sh [options]"
echo
echo "Options:"
echo " -b, --baseurl <URL> The site relative url that start with slash, e.g. '/project'"
echo " -h, --help Print the help information"
echo " -d, --destination <DIR> Destination directory (defaults to ./_site)"
}
init() {
set -eu
if [[ -d .container ]]; then
rm -rf .container
fi
if [[ -d _site ]]; then
jekyll clean
fi
temp=$(mktemp -d)
cp -r * $temp
cp -r .git $temp
mv $temp .container
}
check_unset() {
if [[ -z ${1:+unset} ]]
then
help
exit 1
fi
}
while [[ $# -gt 0 ]]
do
opt="$1"
case $opt in
-b|--baseurl)
check_unset $2
if [[ $2 == \/* ]]
then
CMD+=" -b $2"
else
help
exit 1
fi
shift
shift
;;
-d|--destination)
check_unset $2
DEST=$(realpath $2)
shift;
shift;
;;
-h|--help)
help
exit 0
;;
*) # unknown option
help
exit 1
;;
esac
done
init
cd .container
echo "$ cd $(pwd)"
python _scripts/py/init_all.py
CMD+=" -d ${DEST}"
echo "\$ $CMD"
eval $CMD
echo -e "\nBuild success, the site files placed in '${DEST}'."
if [[ -d ${DEST}/.git ]]; then
if [[ ! -z $(git -C $DEST status -s) ]]; then
git -C $DEST add .
git -C $DEST commit -m "[Automation] Update site files." -q
echo -e "\nPlease push the changes of '$(realpath $DEST)' to remote master branch.\n"
fi
fi
cd .. && rm -rf .container

238
docs/README_zh-CN.md Normal file
View File

@@ -0,0 +1,238 @@
# Jekyll Theme Chirpy
[![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)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](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)
Language: [English](../README.md) | 简体中文
一个不一样的 Jekyll 主题(内附神秘工具),采用响应式设计,方便记录、管理、分享你的知识和经验。
**功能一览**
* 自动暗夜模式
* 文章最后修改日期
* 文章目录
* 自动推荐相关文章
* 语法高亮
* 二级目录
* 搜索
* Atom 订阅
* Disqus 评论
* Google 分析
* GA 浏览报告(高级功能)
* SEO 优化
* 网站性能优化
[**在线体验** »](https://chirpy.cotes.info)
![devices-mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)
## 目录
* [安装](#安装)
* [运行指南](#运行指南)
* [参与贡献](#参与贡献)
* [感谢](#感谢)
* [赞助](#赞助)
* [许可证书](#许可证书)
## 安装
### 准备工作
按照 [Jekyll 官方文档](https://jekyllrb.com/docs/installation/) 完成基础环境的安装 (RubyRubyGemBundler 和 Jekyll)。为了使用项目内免费提供的脚本工具,你还需要安装 [Python](https://www.python.org/downloads/)( >= 3.5) 和 [ruamel.yaml](https://pypi.org/project/ruamel.yaml/)。
如果你的机器系统是 Debian 或者 macOS则需要确保安装了 [GNU coreutils](https://www.gnu.org/software/coreutils/)。否则,通过以下方式获得:
* Debian
```console
$ sudo apt-get install coreutils
```
* macOS
```console
$ brew install coreutils
```
接着,[fork](https://github.com/cotes2020/jekyll-theme-chirpy/fork) 一份代码,然后克隆你 Fork 的仓库到本地机器上。
```console
$ git clone git@github.com:USER/jekyll-theme-chirpy.git
```
`USER` 替换为你的 GitHub username。
### 安装 Jekyll 插件
在根目录下运行:
```terminal
$ bundle install
```
`bundle` 命令会自动安装 `Gemfile` 内声明的依赖插件.
## 运行指南
### 文件目录
下面是主要的文件目录:
```sh
jekyll-theme-chirpy/
├── _data
├── _includes
├── _layouts
├── _posts # posts stay here
├── _scripts
├── .travis.yml # remove it
├── .github # remove this, too
├── assets
├── tabs
│   └── about.md # the ABOUT page
├── .gitignore
├── 404.html
├── Gemfile
├── LICENSE
├── README.md
├── _config.yml # configuration file
├── tools # script tools
├── docs
├── feed.xml
├── index.html
├── robots.txt
└── sitemap.xml
```
你需要将以下文件或目录删除:
- .travis.yml
- .github
### 配置文件
根据个人需要去修改 `_config.yml` 的变量,大部分都有注释介绍用法。
* 头像
示例的头像文件放置在:`/assets/img/sample/avatar.jpg`. 把它换成你自己的头像,路径不限定,越小越好。(压缩图像体积可上这个网站:*<https://tinypng.com/>* ).
* 时区
时区由 `timezone` 定义,默认为 `亚洲/上海`,如果肉身翻墙要换城市可在此列表找到: [TimezoneConverter](http://www.timezoneconverter.com/cgi-bin/findzone/findzone) 或者 [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
### 本地运行
使用以下工具可轻松运行:
```terminal
$ bash tools/run.sh
```
访问本地服务: <http://localhost:4000>
如果你想在本地服务运行后,把修改源文件的更改实时刷新,可使用选项 `-r` (或 `--realtime`),不过要先安装依赖 [**fswatch**](http://emcrisostomo.github.io/fswatch/) 。
### 部署到 GitHub Pages
部署开始前,把 `_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`。
#### 方法 1: 由 GitHub Pages 生成站点
依照本方法,你可以直接把源码推送到远端仓库。
> **注**: 如果你想使用任何不在这个[列表](https://pages.github.com/versions/)上的插件,越过此方法,直接看 [*方法 2: 本地构建*](#方法-2-本地构建).
**1**. 仓库改名为:
|站点类型 | 仓库名称|
|:---|:---|
|User or Organization | `<username>.github.io`|
|Project| `<username>.github.io` 以外的名字,譬如 `project`|
**2**. 提交本地更改,然后运行:
```console
$ bash tools/init.sh
```
>**注**: *最后更新* 列表根据文章的 git 修改记录生成,所以运行前先把 `_posts` 目录的修改提交。
它会自动生成文章的 *最后修改日期* 和 *分类 / 标签* 页面.
**3**. 推送到 `origin/master` 然后到 GitHub 网页为该项目开启 Pages 服务。
**4**. 网站将运行在:
|站点类型 | 网站 URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
#### 方法 2: 本地构建
由于安全原因GitHub Pages 不允许第三方插件运行,如果你想突破规则,就要本地构建站点内容。
**1**. 到 GitHub 网页,创建一个新的仓库,根据以下规则命名:
|站点类型 | 仓库名称|
|:---|:---|
|User or Organization | `<username>.github.io`|
|Project| `<username>.github.io` 以外的名字, 例如 `project`|
然后 Clone 新仓库到本地。
**2**. 构建站点:
```console
$ bash tools/build.sh -d /path/to/local/project/
```
> `project` 为新仓库名称。
生成的静态文件将会在 `/path/to/local/project`. 把新仓库的修改提交并推送到远端 `master` 分支.
**3**. 回到 GithHub 网页,为该仓库开启 Pages 服务。
**4**. 网站将运行在:
|站点类型 | 站点 URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
### 文档
更多细节及更佳的阅读体验,请参阅 [线上教程](https://chirpy.cotes.info/categories/tutorial/)。 与此同时,[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki) 也有一份教程的拷贝。
## 参与贡献
三人行必有我师,欢迎提报告 bug, 帮助改进代码质量,或者提交新功能。具体操作规则请参考[此文](.github/CONTRIBUTING.md),谢谢🙏。
## 感谢
这个主题的开发主要基于 [Jekyll](https://jekyllrb.com/) 生态、[Bootstrap](https://getbootstrap.com/)、[Font Awesome](https://fontawesome.com/) 和其他一些出色的工具 (相关文件中可以找到这些工具的版权信息).
:tada:感谢所有参与代码贡献的小伙伴, 他们的 GayHub ID 在这个[列表](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors)。 另外, 提交过 issues(或者未被合并 PR)的高富帅和白富美也不会被遗忘,他/她们帮助报告 bug、分享新点子或者启发了我写出更通俗易懂的文档。
## 赞助
如果您喜欢这个主题或者它对您有帮助,请考虑打赏作者:在 [项目主页](https://github.com/cotes2020/jekyll-theme-chirpy) 点击按钮 <kbd>:heart:Sponsor</kbd> 选择适合的链接即可完成(国内一般选第二个链接,支付宝/微信赞助),您的打赏将会极大地鼓励作者,并帮助作者更好地维护项目!
## 许可证书
本项目开源,基于 [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) 许可。

View File

@@ -1,6 +1,8 @@
---
layout: compress
# Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT License
---

View File

@@ -1,11 +1,12 @@
---
layout: home
title: Home
breadcrumb:
-
label: Posts
# Index page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---

62
init.sh
View File

@@ -1,62 +0,0 @@
#!/bin/bash
#
# Initial the Categories/Tags pages and Lastmod for posts.
# © 2019 Cotes Chung
# Published under MIT License
CATEGORIES=false
TAGS=false
LASTMOD=false
set -eu
if [[ ! -z $(git status -s) ]]; then
echo "Warning: Commit the changes of the repository first."
git status -s
exit 1
fi
python _scripts/py/init_all.py
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
msg="Updated"
if [[ ! -z $(git status categories -s) ]]; then
git add categories/
msg+=" the Categories"
CATEGORIES=true
fi
if [[ ! -z $(git status tags -s) ]]; then
git add tags/
if [[ $CATEGORIES = true ]]; then
msg+=","
else
msg+=" the"
fi
msg+=" Tags"
TAGS=true
fi
if [[ ! -z $(git status _posts -s) ]]; then
git add _posts/
if [[ $CATEGORIES = true || $TAGS = true ]]; then
msg+=","
else
msg+=" the"
fi
msg+=" Lastmod"
LASTMOD=true
fi
if [[ $CATEGORIES = true || $TAGS = true || $LASTMOD = true ]]; then
msg+=" for post(s)."
git commit -m "[Automation] $msg"
else
msg="Nothing changed."
fi
echo $msg

View File

@@ -1,5 +1,7 @@
---
# The robots rules
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
layout: null

View File

@@ -1,6 +1,9 @@
---
layout: compress
# The Sitemap template
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
@@ -41,7 +44,30 @@ layout: compress
{% for page in site.pages %}
{% if site.sitemap_exclude contains page.url %}
{% assign pass = false %}
{% for fuzzy in site.sitemap_exclude.fuzzy %}
{% if page.url contains fuzzy %}
{% assign pass = true %}
{% break %}
{% endif %}
{% endfor %}
{% unless pass %}
{% for accurate in site.sitemap_exclude.accurate %}
{% assign len = accurate | size %}
{% capture beg %}{{ 0 | minus: len }}{% endcapture %}
{% capture tail %}{{ page.url | slice: beg, len }}{% endcapture %}
{% if tail == accurate %}
{% assign pass = true %}
{% break %}
{% endif %}
{% endfor %}
{% endunless %}
{% if pass %}
{% continue %}
{% endif %}

View File

@@ -2,6 +2,8 @@
title: About
# The About page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---

View File

@@ -2,6 +2,8 @@
title: Archives
# The Archives of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---

View File

@@ -2,6 +2,8 @@
title: Categories
# All the Categories of posts
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---

View File

@@ -2,6 +2,8 @@
title: Tags
# All the Tags of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---

120
tools/build.sh Executable file
View File

@@ -0,0 +1,120 @@
#!/bin/bash
#
# Build jekyll site and store site files in ./_site
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# Published under MIT License
set -eu
CMD="JEKYLL_ENV=production bundle exec jekyll b"
WORK_DIR=$(dirname $(dirname $(realpath "$0")))
CONTAINER=${WORK_DIR}/.container
DEST=${WORK_DIR}/_site
help() {
echo "Usage:"
echo
echo " bash build.sh [options]"
echo
echo "Options:"
echo " -b, --baseurl <URL> The site relative url that start with slash, e.g. '/project'"
echo " -h, --help Print the help information"
echo " -d, --destination <DIR> Destination directory (defaults to ./_site)"
}
init() {
cd $WORK_DIR
if [[ -d $CONTAINER ]]; then
rm -rf $CONTAINER
fi
if [[ -d _site ]]; then
jekyll clean
fi
temp=$(mktemp -d)
cp -r * $temp
cp -r .git $temp
mv $temp $CONTAINER
}
build() {
cd $CONTAINER
echo "$ cd $(pwd)"
python _scripts/py/init_all.py
CMD+=" -d ${DEST}"
echo "\$ $CMD"
eval $CMD
echo -e "\nBuild success, the site files have been placed in '${DEST}'."
if [[ -d ${DEST}/.git ]]; then
if [[ ! -z $(git -C $DEST status -s) ]]; then
git -C $DEST add .
git -C $DEST commit -m "[Automation] Update site files." -q
echo -e "\nPlease push the changes of $DEST to remote master branch.\n"
fi
fi
cd .. && rm -rf $CONTAINER
}
check_unset() {
if [[ -z ${1:+unset} ]]
then
help
exit 1
fi
}
main() {
while [[ $# -gt 0 ]]
do
opt="$1"
case $opt in
-b|--baseurl)
check_unset $2
if [[ $2 == \/* ]]
then
CMD+=" -b $2"
else
help
exit 1
fi
shift
shift
;;
-d|--destination)
check_unset $2
DEST=$(realpath $2)
shift;
shift;
;;
-h|--help)
help
exit 0
;;
*) # unknown option
help
exit 1
;;
esac
done
init
build
}
main "$@"

85
tools/init.sh Executable file
View File

@@ -0,0 +1,85 @@
#!/bin/bash
#
# Initial the Categories/Tags pages and Lastmod for posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# Published under MIT License
set -eu
CATEGORIES=false
TAGS=false
LASTMOD=false
WORK_DIR=$(dirname $(dirname $(realpath "$0")))
check_status() {
if [[ ! -z $(git status -s) ]]; then
echo "Warning: Commit the changes of the repository first."
git status -s
exit 1
fi
}
update_files() {
python _scripts/py/init_all.py
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
}
commit() {
msg="Updated"
if [[ ! -z $(git status categories -s) ]]; then
git add categories/
msg+=" the Categories"
CATEGORIES=true
fi
if [[ ! -z $(git status tags -s) ]]; then
git add tags/
if [[ $CATEGORIES = true ]]; then
msg+=","
else
msg+=" the"
fi
msg+=" Tags"
TAGS=true
fi
if [[ ! -z $(git status _posts -s) ]]; then
git add _posts/
if [[ $CATEGORIES = true || $TAGS = true ]]; then
msg+=","
else
msg+=" the"
fi
msg+=" Lastmod"
LASTMOD=true
fi
if [[ $CATEGORIES = true || $TAGS = true || $LASTMOD = true ]]; then
msg+=" for post(s)."
git commit -m "[Automation] $msg"
else
msg="Nothing changed."
fi
echo $msg
}
main() {
cd $WORK_DIR
check_status
update_files
commit
}
main

75
tools/js-compress.sh Executable file
View File

@@ -0,0 +1,75 @@
#!/bin/bash
#
# A development tool that use yuicompressor to compress JS files.
#
#
# Requirement:
# - wget
# - JRE
# - yuicompressor https://github.com/yui/yuicompressor
#
#
# Usage: bash /path/to/js-compress.sh
#
# Process:
# input: /path/to/js/source.js --> output: /path/to/js/dist/source.min.js
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
set -eu
PROJ_HOME=$(dirname $(dirname $(realpath "$0")))
YUICOMPRESSOR_SRC=https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar
YUICOMPRESSOR=${PROJ_HOME}/tools/package/yuicompressor-2.4.8.jar
JS_ROOT=${PROJ_HOME}/assets/js/
JS_SRC=${JS_ROOT}_src # JS source files
JS_DEST=${JS_ROOT}dist # Compressed output directory
PREFIX_LEN=${#JS_ROOT} # To beautify the log
function init() {
if [[ ! -f $YUICOMPRESSOR ]]; then
if [[ ! -d "${PROJ_HOME}/tools/package/" ]]; then
mkdir -p "${PROJ_HOME}/tools/package/"
fi
wget "$YUICOMPRESSOR_SRC" -P "${PROJ_HOME}/tools/package/" -q
fi
}
function compress() {
# $1 is the source dir
# $2 is the destination dir
# $3 is the sub dir of source dir, nullable
if [[ -z ${3:+unset} ]]
then
sub_dir=""
else
sub_dir="$3/"
fi
for item in $(ls $1)
do
src="$1/$item"
if [[ -d "$src" ]]; then
compress $src $2 $item # recursion
else
if [[ ! -d "$2/${sub_dir}" ]]; then
mkdir -p $2/${sub_dir}
fi
output=$2/${sub_dir}${item%.*}.min.js
echo "java -jar $(basename $YUICOMPRESSOR) ${src:$PREFIX_LEN} -o ${output:$PREFIX_LEN}"
java -jar $YUICOMPRESSOR $src -o $output
fi
done
sub_dir="" # clean up for next recursion.
}
init
compress $JS_SRC $JS_DEST

View File

@@ -7,15 +7,19 @@
# - jq
# - wget
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT Licensed
URL_FILE=assets/data/proxy.json
PV_CACHE=assets/data/pageviews.json
set -eu
WORK_DIR=$(dirname $(dirname $(realpath "$0")))
URL_FILE=${WORK_DIR}/assets/data/proxy.json
PV_CACHE=${WORK_DIR}/assets/data/pageviews.json
PROXY_URL=$(jq -r '.proxyUrl' $URL_FILE)
wget $PROXY_URL -O $PV_CACHE

View File

@@ -5,17 +5,22 @@
# Requirement:
# Option '-r, --realtime' needs fswatch http://emcrisostomo.github.io/fswatch/
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# Published under MIT License
set -eu
WORK_DIR=$(dirname $(dirname $(realpath "$0")))
WORK_DIR=$PWD
CONTAINER=.container
SYNC_TOOL=_scripts/sh/sync_monitor.sh
cmd="bundle exec jekyll s"
realtime=false
help() {
echo "Usage:"
echo
@@ -32,23 +37,21 @@ help() {
cleanup() {
cd $WORK_DIR
rm -rf $CONTAINER
rm -rf ${WORK_DIR}/${CONTAINER}
ps aux | grep fswatch | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
}
init() {
set -eu
if [[ -d $CONTAINER ]]; then
rm -rf $CONTAINER
if [[ -d ${WORK_DIR}/${CONTAINER} ]]; then
rm -rf ${WORK_DIR}/${CONTAINER}
fi
temp=$(mktemp -d)
cp -r * $temp
cp -r .git $temp
mv $temp $CONTAINER
cp -r ${WORK_DIR}/* $temp
cp -r ${WORK_DIR}/.git $temp
mv $temp ${WORK_DIR}/${CONTAINER}
trap cleanup INT
}
@@ -74,7 +77,7 @@ check_command() {
main() {
init
cd $CONTAINER
cd ${WORK_DIR}/${CONTAINER}
python _scripts/py/init_all.py
if [[ $realtime = true ]]; then

22
tools/test.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
#
# Using HTML-proofer to test site.
#
# Requirement: https://github.com/gjtorikian/html-proofer
#
# Usage: bash /path/to/test.sh
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
DEST=_site
URL_IGNORE=cdn.jsdelivr.net
bundle exec htmlproofer $DEST \
--disable-external \
--check-html \
--empty_alt_ignore \
--allow_hash_href \
--url_ignore $URL_IGNORE