Skip to content

Commit

Permalink
docs: update tutorial and readme
Browse files Browse the repository at this point in the history
Change Dev Containers logo in README:

Simple Icons has removed all Microsoft icons due to copyright restrictions, see <simple-icons/simple-icons#11236>
  • Loading branch information
cotes2020 committed Aug 27, 2024
1 parent fc3d101 commit 8b7dba7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

A minimal, responsive, and feature-rich Jekyll theme for technical writing.

[![Open in Dev Containers](https://img.shields.io/badge/Dev_Containers-Open-deepskyblue?logo=visualstudiocode)][open-container]&nbsp;
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?&logo=RubyGems&logoColor=ghostwhite&label=gem&color=tomato)][gem]&nbsp;
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy)][license]&nbsp;
[![CI](https://img.shields.io/github/actions/workflow/status/cotes2020/jekyll-theme-chirpy/ci.yml?logo=github)][ci]&nbsp;
[![Codacy Badge](https://img.shields.io/codacy/grade/4e556876a3c54d5e8f2d2857c4f43894?logo=codacy)][codacy]
[![Codacy Badge](https://img.shields.io/codacy/grade/4e556876a3c54d5e8f2d2857c4f43894?logo=codacy)][codacy]&nbsp;
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy?color=goldenrod)][license]&nbsp;
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?&logo=RubyGems&logoColor=ghostwhite&label=gem&color=orange)][gem]&nbsp;
[![Open in Dev Containers](https://img.shields.io/badge/Dev_Containers-Open-deepskyblue?logo=linuxcontainers)][open-container]

[**Live Demo**][demo]

Expand Down
67 changes: 38 additions & 29 deletions _posts/2019-08-09-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,70 @@ pin: true
media_subpath: '/posts/20180809'
---

## Creating a site repository
## Creating a Site Repository

There are two methods to create a site repository for **Chirpy**:
When creating your site repository, you have two options depending on your needs:

- [**Using the starter**](#option-1-using-the-starter) — This approach simplifies upgrades and isolates unnecessary project files, enabling you to concentrate on your content. It's ideal for those who want a hassle-free setup focused primarily on writing.
- [**Forking the theme**](#option-2-forking-the-theme) — This method allows for customization and development but presents challenges during upgrades. It is not recommended to use this approach unless you are familiar with Jekyll and plan to modify this project.
### Option 1. Using the Starter (Recommended)

### Option 1: using the starter
This approach simplifies upgrades, isolates unnecessary files, and is perfect for users who want to focus on writing with minimal configuration.

1. Sign in to GitHub and navigate to the [**starter**][starter].
2. Click the <kbd>Use this template</kbd> button and then select <kbd>Create a new repository</kbd>.
3. Name the new repository `<username>.github.io`, replacing `username` with your lowercase GitHub username.

### Option 2: forking the theme
### Option 2. Forking the Theme

Sign in to GitHub and [fork the theme](https://github.com/cotes2020/jekyll-theme-chirpy/fork).
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.

## Name your new repository
1. Sign in to GitHub.
2. [Fork the theme repository](https://github.com/cotes2020/jekyll-theme-chirpy/fork).
3. Name the new repository `<username>.github.io`, replacing `username` with your lowercase GitHub username.

Rename your repository to `<username>.github.io`. The `username` represents your lowercase GitHub username.
## Setting up the Environment

## Setting up the environment
Once your repository is created, it's time to set up your development environment. There are two primary methods:

The easiest way to set up the runtime environment, especially on Windows, is by using [Dev Containers](#setting-up-in-dev-containers). This method installs all packages within a Docker container, isolating them from the host machine and ensuring no interference with existing settings.
### Using Dev Containers (Recommended for Windows)

For Unix-like systems, besides using Dev Containers, you can also [natively set up](#setting-up-natively) the runtime environment to achieve optimal performance.
Dev Containers offer an isolated environment using Docker, which prevents conflicts with your system and ensures all dependencies are managed within the container.

### Setting up in Dev Containers
**Steps**:

1. Install Docker:
- On Windows/macOS, install [Docker Desktop][docker-desktop].
- On Linux, install [Docker Engine][docker-engine].
2. Install [VS Code][vscode] and the [Dev Containers extension][dev-containers].
3. Clone your repository:
- For Docker Desktop: Start VS Code and [clone your repo in a container volume][dc-clone-in-vol].
- For Docker Engine: Clone your repo to the local disk, then launch VS Code and [open your repo in the container][dc-open-in-container].
4. Wait a few minutes for Dev Containers to finish installing.
- For Docker Engine: Clone your repo locally, then [open it in a container][dc-open-in-container] via VS Code.
4. Wait for the Dev Containers setup to complete.

### Setting up natively
### Setting up Natively (Recommended for Unix-like OS)

1. Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of the basic environment. Ensure that [Git](https://git-scm.com/) is also installed.
2. Clone your repository to a local disk.
3. If your site is created by forking the theme, install [Node.js][nodejs] and run `bash tools/init.sh` in the root directory. This will initialize the repository files and create a commit to save the changes.
4. Install the dependencies by running `bundle`.
For Unix-like systems, you can set up the environment natively for optimal performance, though you can also use Dev Containers as an alternative.

### Start the local server
**Steps**:

1. Follow the [Jekyll installation guide](https://jekyllrb.com/docs/installation/) to install Jekyll and ensure [Git](https://git-scm.com/) is installed.
2. Clone your repository to your local machine.
3. If you forked the theme, install [Node.js][nodejs] and run `bash tools/init.sh` in the root directory to initialize the repository.
4. Run command `bundle` in the root of your repository to install the dependencies.

## Usage

### Start the Jekyll Server

To run the site locally, use the following command:

```console
```terminal
$ bundle exec jekyll s
```

After a few seconds, the local server will be available at <http://127.0.0.1:4000>.
> If you are using Dev Containers, you must run that command in the **VS Code** Terminal.
{: .prompt-info }

## Usage
After a few seconds, the local server will be available at <http://127.0.0.1:4000>.

### Configuration

Expand All @@ -76,17 +85,17 @@ Update the variables in `_config.yml`{: .filepath} as needed. Some typical optio
- `timezone`
- `lang`

### Social contact options
### Social Contact Options

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.

### Customizing the stylesheet
### Customizing the Stylesheet

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.

Starting with version `6.2.0`, if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`{: .filepath}, copy the main SASS file `_sass/main.scss`{: .filepath} to the `_sass`{: .filepath} directory in your site's source, then create a new file `_sass/variables-hook.scss`{: .filepath} and assign your new values there.

### Customizing static assets
### Customizing Static Assets

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.

Expand All @@ -98,7 +107,7 @@ Before deploying, check the `_config.yml`{: .filepath} file and ensure the `url`

Now you can choose _ONE_ of the following methods to deploy your Jekyll site.

### Deploy using GitHub Actions
### Deploy Using Github Actions

Prepare the following:

Expand All @@ -119,7 +128,7 @@ Next, configure the _Pages_ service:

You can now visit the URL provided by GitHub to access your site.

### Manual build and deployment
### Manual Build and Deployment

For self-hosted servers, you will need to build the site on your local machine and then upload the site files to the server.

Expand Down

0 comments on commit 8b7dba7

Please sign in to comment.