Skip to content

Commit 8560579

Browse files
committed
Initial GitHub pages site with Jekyll
1 parent c0e4756 commit 8560579

20 files changed

+181
-48
lines changed

_config.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ theme: jekyll-theme-chirpy
55

66
# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm
77
# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed,
8-
# otherwise, the layout language will use the default value of 'en'.
8+
# otherwise, the layout language will use the default value of 'en'. zh-TW
9+
# lang: en
910
lang: en
1011

1112
# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker
@@ -14,28 +15,28 @@ timezone: Asia/Shanghai
1415
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
1516
# ↓ --------------------------
1617

17-
title: Chirpy # the main title
18+
title: Sea # the main title
1819

19-
tagline: A text-focused Jekyll theme # it will display as the subtitle
20+
tagline: A fun sharing website # it will display as the subtitle
2021

2122
description: >- # used by seo meta and the atom feed
22-
A minimal, responsive and feature-rich Jekyll theme for technical writing.
23+
A fun sharing website, Mainly used to share study notes, experiences, game demos, etc.
2324
2425
# Fill in the protocol & hostname for your site.
2526
# E.g. 'https://username.github.io', note that it does not end with a '/'.
2627
url: ""
2728

2829
github:
29-
username: github_username # change to your GitHub username
30+
username: mHai2015 # change to your GitHub username
3031

3132
twitter:
3233
username: twitter_username # change to your Twitter username
3334

3435
social:
3536
# Change to your full name.
3637
# It will be displayed as the default author of the posts and the copyright owner in the Footer
37-
name: your_full_name
38-
email: example@domain.com # change to your email address
38+
name: hai
39+
email: hai0312@163.com # change to your email address
3940
links:
4041
# The first element serves as the copyright owner's link
4142
- https://twitter.com/username # change to your Twitter homepage
@@ -95,10 +96,11 @@ theme_mode: # [light | dark]
9596
# will be added to all media resources (site avatar, posts' images, audio and video files) paths starting with '/'
9697
#
9798
# e.g. 'https://cdn.com'
98-
cdn: "https://chirpy-img.netlify.app"
99+
# cdn: "https://chirpy-img.netlify.app"
100+
cdn: "/assets/img"
99101

100102
# the avatar on sidebar, support local or CORS resources
101-
avatar: "/commons/avatar.jpg"
103+
avatar: "/commons/avatar.png"
102104

103105
# The URL of the site-wide social preview image used in SEO `og:image` meta tag.
104106
# It can be overridden by a customized `page.image` in front matter.

_data/authors.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
# url: {homepage_of_author}
77
# -------------------------------------
88

9-
cotes:
10-
name: Cotes Chung
11-
twitter: cotes2020
12-
url: https://github.com/cotes2020/
9+
author_hai:
10+
name: hai
11+
twitter: hai_2015
12+
url: https://github.com/mHai2015/
1313

14-
sille_bille:
15-
name: Dinesh Prasanth Moluguwan Krishnamoorthy
16-
twitter: dinesh_MKD
17-
url: https://github.com/SilleBille/
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
title: 第一個網站
3+
description: >-
4+
Get started with Chirpy basics in this comprehensive overview.
5+
You will learn how to install, configure, and use your first Chirpy-based website, as well as deploy it to a web server.
6+
author: author_hai
7+
date: 2019-08-09 20:55:00 +0800
8+
categories: [Blogging, Tutorial]
9+
tags: [getting started, 中文]
10+
pin: true
11+
media_subpath: '/posts/20180809'
12+
lang: zh-TW
13+
---
14+
15+
## Creating a Site Repository
16+
17+
When creating your site repository, you have two options depending on your needs:
18+
19+
### Option 1. Using the Starter (Recommended)
20+
21+
This approach simplifies upgrades, isolates unnecessary files, and is perfect for users who want to focus on writing with minimal configuration.
22+
23+
1. Sign in to GitHub and navigate to the [**starter**][starter].
24+
2. Click the <kbd>Use this template</kbd> button and then select <kbd>Create a new repository</kbd>.
25+
3. Name the new repository `<username>.github.io`, replacing `username` with your lowercase GitHub username.
26+
27+
### Option 2. Forking the Theme
28+
29+
This approach is convenient for modifying features or UI design, but presents challenges during upgrades. So don't try this unless you are familiar with Jekyll and plan to heavily modify this theme.
30+
31+
1. Sign in to GitHub.
32+
2. [Fork the theme repository](https://github.com/cotes2020/jekyll-theme-chirpy/fork).
33+
3. Name the new repository `<username>.github.io`, replacing `username` with your lowercase GitHub username.
34+
35+
## Setting up the Environment
36+
37+
Once your repository is created, it's time to set up your development environment. There are two primary methods:
38+
39+
### Using Dev Containers (Recommended for Windows)
40+
41+
Dev Containers offer an isolated environment using Docker, which prevents conflicts with your system and ensures all dependencies are managed within the container.
42+
43+
**Steps**:
44+
45+
1. Install Docker:
46+
- On Windows/macOS, install [Docker Desktop][docker-desktop].
47+
- On Linux, install [Docker Engine][docker-engine].
48+
2. Install [VS Code][vscode] and the [Dev Containers extension][dev-containers].
49+
3. Clone your repository:
50+
- For Docker Desktop: Start VS Code and [clone your repo in a container volume][dc-clone-in-vol].
51+
- For Docker Engine: Clone your repo locally, then [open it in a container][dc-open-in-container] via VS Code.
52+
4. Wait for the Dev Containers setup to complete.
53+
54+
### Setting up Natively (Recommended for Unix-like OS)
55+
56+
For Unix-like systems, you can set up the environment natively for optimal performance, though you can also use Dev Containers as an alternative.
57+
58+
**Steps**:
59+
60+
1. Follow the [Jekyll installation guide](https://jekyllrb.com/docs/installation/) to install Jekyll and ensure [Git](https://git-scm.com/) is installed.
61+
2. Clone your repository to your local machine.
62+
3. If you forked the theme, install [Node.js][nodejs] and run `bash tools/init.sh` in the root directory to initialize the repository.
63+
4. Run command `bundle` in the root of your repository to install the dependencies.
64+
65+
## Usage
66+
67+
### Start the Jekyll Server
68+
69+
To run the site locally, use the following command:
70+
71+
```terminal
72+
$ bundle exec jekyll serve
73+
```
74+
75+
> If you are using Dev Containers, you must run that command in the **VS Code** Terminal.
76+
{: .prompt-info }
77+
78+
After a few seconds, the local server will be available at <http://127.0.0.1:4000>.
79+
80+
### Configuration
81+
82+
Update the variables in `_config.yml`{: .filepath} as needed. Some typical options include:
83+
84+
- `url`
85+
- `avatar`
86+
- `timezone`
87+
- `lang`
88+
89+
### Social Contact Options
90+
91+
Social contact options are displayed at the bottom of the sidebar. You can enable or disable specific contacts in the `_data/contact.yml`{: .filepath} file.
92+
93+
### Customizing the Stylesheet
94+
95+
To customize the stylesheet, copy the theme's `assets/css/jekyll-theme-chirpy.scss`{: .filepath} file to the same path in your Jekyll site, and add your custom styles at the end of the file.
96+
97+
### Customizing Static Assets
98+
99+
Static assets configuration was introduced in version `5.1.0`. The CDN of the static assets is defined in `_data/origin/cors.yml`{: .filepath }. You can replace some of them based on the network conditions in the region where your website is published.
100+
101+
If you prefer to self-host the static assets, refer to the [_chirpy-static-assets_](https://github.com/cotes2020/chirpy-static-assets#readme) repository.
102+
103+
## Deployment
104+
105+
Before deploying, check the `_config.yml`{: .filepath} file and ensure the `url` is configured correctly. If you prefer a [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or if you want to visit your website with a base URL on a web server other than **GitHub Pages**, remember to set the `baseurl` to your project name, starting with a slash, e.g., `/project-name`.
106+
107+
Now you can choose _ONE_ of the following methods to deploy your Jekyll site.
108+
109+
### Deploy Using Github Actions
110+
111+
Prepare the following:
112+
113+
- If you're on the GitHub Free plan, keep your site repository public.
114+
- If you have committed `Gemfile.lock`{: .filepath} to the repository, and your local machine is not running Linux, update the platform list of the lock file:
115+
116+
```console
117+
$ bundle lock --add-platform x86_64-linux
118+
```
119+
120+
Next, configure the _Pages_ service:
121+
122+
1. Go to your repository on GitHub. Select the _Settings_ tab, then click _Pages_ in the left navigation bar. In the **Source** section (under _Build and deployment_), select [**GitHub Actions**][pages-workflow-src] from the dropdown menu.
123+
![Build source](pages-source-light.png){: .light .border .normal w='375' h='140' }
124+
![Build source](pages-source-dark.png){: .dark .normal w='375' h='140' }
125+
126+
2. Push any commits to GitHub to trigger the _Actions_ workflow. In the _Actions_ tab of your repository, you should see the workflow _Build and Deploy_ running. Once the build is complete and successful, the site will be deployed automatically.
127+
128+
You can now visit the URL provided by GitHub to access your site.
129+
130+
### Manual Build and Deployment
131+
132+
For self-hosted servers, you will need to build the site on your local machine and then upload the site files to the server.
133+
134+
Navigate to the root of the source project, and build your site with the following command:
135+
136+
```console
137+
$ JEKYLL_ENV=production bundle exec jekyll b
138+
```
139+
140+
Unless you specified the output path, the generated site files will be placed in the `_site`{: .filepath} folder of the project's root directory. Upload these files to your target server.
141+
142+
[nodejs]: https://nodejs.org/
143+
[starter]: https://github.com/cotes2020/chirpy-starter
144+
[pages-workflow-src]: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow
145+
[docker-desktop]: https://www.docker.com/products/docker-desktop/
146+
[docker-engine]: https://docs.docker.com/engine/install/
147+
[vscode]: https://code.visualstudio.com/
148+
[dev-containers]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
149+
[dc-clone-in-vol]: https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume
150+
[dc-open-in-container]: https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container

assets/img/commons/IMG_9499.png

485 KB
Loading

assets/img/commons/IMG_9825.JPEG

337 KB
Loading

assets/img/commons/avatar.png

1.95 MB
Loading
74.3 KB
Loading
-19.5 KB
Binary file not shown.
-61.1 KB
Binary file not shown.
40.2 KB
Loading

0 commit comments

Comments
 (0)