Skip to content

Commit 32cd311

Browse files
committed
Init commit
0 parents  commit 32cd311

27 files changed

+886
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
# 2 space indentation
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
# Unix-style newlines with a newline ending every file
10+
end_of_line = lf
11+
insert_final_newline = true

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto
3+
4+
# Force bash scripts to always use LF line endings so that if a repo is accessed
5+
# in Unix via a file share from Windows, the scripts will work.
6+
*.sh text eol=lf
7+
8+
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
9+
# in Windows via a file share from Linux, the scripts will work.
10+
*.{cmd,[cC][mM][dD]} text eol=crlf
11+
*.{bat,[bB][aA][tT]} text eol=crlf
12+
13+
# Denote all files that are truly binary and should not be modified.
14+
*.png binary
15+
*.jpg binary
16+
*.ico binary

.github/workflows/pages-deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: 'Automatic build'
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- .gitignore
8+
- README.md
9+
- LICENSE
10+
11+
jobs:
12+
continuous-delivery:
13+
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
GEMS_PATH: ~/vendor/bundle
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0 # for posts's lastmod
24+
25+
- name: Setup Ruby
26+
uses: actions/setup-ruby@v1
27+
with:
28+
ruby-version: 2.7
29+
30+
- name: Bundle Caching
31+
uses: actions/cache@v2
32+
with:
33+
path: ${{ env.GEMS_PATH }}
34+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-gems-
37+
38+
- name: Bundle Install
39+
run: |
40+
bundle config path ${{ env.GEMS_PATH }}
41+
bundle install --jobs 4 --retry 3
42+
43+
- name: Check baseurl
44+
run: |
45+
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
46+
if [[ -n $baseurl ]]; then
47+
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
48+
fi
49+
50+
- name: Build Site
51+
env:
52+
JEKYLL_ENV: production
53+
run: |
54+
bundle exec jekyll b -d "_site$BASE_URL"
55+
56+
- name: Test Site
57+
run: |
58+
bash tools/test.sh
59+
60+
- name: Deploy
61+
run: |
62+
if [[ -n $BASE_URL ]]; then
63+
mv _site$BASE_URL _site-rename
64+
rm -rf _site
65+
mv _site-rename _site
66+
fi
67+
68+
bash tools/deploy.sh

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# hidden files
2+
.*
3+
!.github
4+
5+
# jekyll cache
6+
_site
7+
vendor
8+
9+
# rubygem
10+
*.gem
11+
12+
# npm dependencies
13+
node_modules
14+
package-lock.json

404.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: page
3+
title: "404: Page not found"
4+
permalink: /404.html
5+
6+
redirect_from:
7+
- /norobots/
8+
- /assets/
9+
- /tabs/
10+
- /categories/
11+
- /tags/
12+
- /posts/
13+
14+
dynamic_title: true
15+
---
16+
17+
<div class="lead">
18+
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
19+
<p><a href="{{ site.baseurl }}/">Head back Home</a> to try finding it again, or search for it on the <a href="{{ site.baseurl }}/tabs/archives">Archives page</a>.</p>
20+
</div>

Gemfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll-theme-chirpy"
4+
5+
# If you have any plugins, put them here!
6+
group :jekyll_plugins do
7+
# gem "jekyll-xxx", "~> x.y"
8+
end
9+
10+
group :test do
11+
gem "html-proofer", "~> 3.18"
12+
end
13+
14+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
15+
# and associated library.
16+
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
17+
gem "tzinfo", "~> 1.2"
18+
gem "tzinfo-data"
19+
end
20+
21+
# # # Performance-booster for watching directories on Windows
22+
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Cotes Chung
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Chirpy Starter
2+
3+
The startup template for [**Jekyll Theme Chirpy**][chirpy].
4+
5+
When installing the `jekyll-theme-chirpy` through [RubyGem][gem], Jekyll can only read files in the folders `_includes`, `_layout`, `_sass` and `assets`, as well as a small part of variables of the file `_config.yml` from the theme's gem (use the command `bundle info --path jekyll-theme-chirpy` to locate). To fully use all the features of `jekyll-theme-chirpy`, you also need to copy other files/directories and site variables from the theme's gem to your Jekyll site. This will be boring, so we extract all the other required things of the theme's gem to help you quickly use `jekyll-theme-chirpy`.
6+
7+
[gem]: https://rubygems.org/gems/jekyll-theme-chirpy
8+
[chirpy]: https://github.com/cotes2020/jekyll-theme-chirpy/
9+
10+
**File Directory Struct**
11+
12+
```shell
13+
.
14+
├── .github
15+
│   └── workflows
16+
│   └── pages-deploy.yml # the GitHub Actions workflow
17+
├── Gemfile
18+
├── LICENSE
19+
├── README.md # this file
20+
├── _config.yml # all variables are from the theme's gem, except the option `theme`
21+
├── _data # from the theme's gem
22+
├── _plugins # idem
23+
├── _tabs # idem
24+
├── app.js # idem
25+
├── feed.xml # idem
26+
├── index.html # idem
27+
├── 404.html # idem
28+
├── robots.txt # idem
29+
└── sw.js # idem
30+
31+
```
32+
33+
## Installation
34+
35+
[Use this template][usetemplate] to generate a new repository, and then execute:
36+
37+
[usetemplate]: https://github.com/cotes2020/chirpy-starter/generate
38+
39+
```
40+
$ bundle
41+
```
42+
43+
## Usage
44+
45+
### Customing Stylesheet
46+
47+
Creare a new file `/assets/css/style.scss` in your Jekyll site.
48+
49+
And then add the following content:
50+
51+
```scss
52+
---
53+
---
54+
55+
@import {{ site.theme }}
56+
57+
// add your style below
58+
```
59+
60+
### Changing the Number of Tabs
61+
62+
When adding or deleting files in the `_tabs` folder, you need to complete [Custom Stylesheet](#custom-stylesheet) first, and then add a new line before `@import`:
63+
64+
```scss
65+
$tab-count: {{ site.tabs | size | plus: 1 }};
66+
```
67+
68+
### Publishing to GitHub Pages
69+
70+
See the `jekyll-theme-chirpy`'s [deployment instructions](https://github.com/cotes2020/jekyll-theme-chirpy#deployment). Note that in order to use GitHub Actions caching to speed up the deployment, you should add the `Gemfile.lock` file to your repository.
71+
72+
### Updating
73+
74+
Please note that files and directories in this project may change as the [`jekyll-theme-chirpy`][chirpy] is updated. When updating, please ensure that the file directory structure of your Jekyll site is the same as that of this project.
75+
76+
And then execute:
77+
78+
```console
79+
$ bundle update jekyll-theme-chirpy
80+
```
81+
82+
## Documentation
83+
84+
See the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy#documentation).
85+
86+
## License
87+
88+
This work is published under [MIT](https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE) License.

0 commit comments

Comments
 (0)