Skip to content
Go back

Jekyll을 사용하여 GitHub Pages 사이트 만들기

Edit page

GitHub Pages, Jekyll, 그리고 설치법 몇가지와 문서오류에 대해

jekyllrb.com

Table of contents

Open Table of contents

GitHub Pages

https://docs.github.com/ko/pages

GitHub를 통해 호스트되고 게시되는 퍼블릭 웹 페이지로서,
문서에 따르면 저장소를 먼저 만들라고 하지만, 테마를 사용할 경우 건너뛰도록 한다.

Create a new repository

저장소 이름을 username.github.io 으로 지정하면, “특별한” GitHub Pages 저장소로 사용된다.

  1. 새 저장소 만들기 : + 클릭/ New repository
    • owner/username.github.io
    • main 브랜치를 사용
    • 프로젝트일 경우 : owner.github.io/projectname, gh-pages 브랜치를 사용
  2. 저장소 공개여부 : Public
  3. README로 초기화
  4. Create repository 클릭

GitHub Pages는 GitHub Actions를 사용하여 내부의 Jekyll 빌드를 실행하여 사이트를 게시한다.
게시 소스 구성은 기본적으로 Deploy from a branch 으로 설정되며, 시작파일 (README.md) 을 콘텐츠로 하여 자동빌드 및 배포된다.

  • repository/ Settings/ Code and automation - Pages/ Build and deployment/ Deploy from a branch: main, /root
  • repository/ Actions/ pages build and deployment (1 workflow run !)

Adding a theme

Theme Chooser

기능 삭제되었다. (deprecated, 2022.8.22)

Theme template (repository)

테마 커스터마이징에 제한이 있을 수 있다.

https://github.com/cotes2020/chirpy-starter
https://github.com/gwenneg/blog-jekyll-asciidoc-template (Minimal Mistakes)

Use this template → Create a new repository: owner/username.github.io

Fork or clone a theme (repository)

https://github.com/cotes2020/jekyll-theme-chirpy

# 로컬 작업시,
git clone https://github.com/owner/username.github.io.git

cd username.github.io
bash tools/init.sh
bundle
npm install && npm run build

Configure a publishing source

게시 소스 구성을 GitHub Actions으로 변경하여, 미리 설치된 Jekyll 사이트를 패키징하거나 정적 HTML을 배포할 수 있다.


Jekyll

https://jekyllrb.com/docs/

지킬은 간단한 정적 사이트 생성기이다. 복잡함 없는 파일 기반 CMS.
콘텐츠를 가져와 Markdown 및 Liquid 템플릿을 렌더링하여 정적 웹사이트를 생성한다.
GitHub Pages의 엔진으로 GitHub 저장소에서 바로 사이트를 호스팅하는데 사용되고 있다.

Install

Requirements

Instructions

gem install jekyll bundler
jekyll -v     # jekyll 4.4.1
bundler -v    # Bundler version 2.6.8

# 지킬을 구성한다. 테마를 사용할 경우 git clone 한다.
jekyll new username.github.io
cd username.github.io
# ├── _config.yml
# ├── _posts/
# │   └── 2025-06-07-welcome-to-jekyll.markdown
# ├── .gitignore
# ├── 404.html
# ├── about.markdown
# ├── Gemfile
# ├── Gemfile.lock
# └── index.markdown

bundle exec jekyll serve --livereload
# browse to http://localhost:4000
# press ctrl-c to stop.

# ├── _site/
# │   ├── 404.html
# │   ├── about
# │   │   └── index.html
# │   ├── assets
# │   │   ├── main.css
# │   │   ├── main.css.map
# │   │   └── minima-social-icons.svg
# │   ├── feed.xml
# │   ├── index.html
# │   └── jekyll
# │       └── update
# │           └── 2025
# │               └── 06
# │                   └── 07
# │                       └── welcome-to-jekyll.html
# └── .jekyll-cache

# If you are using Ruby version 3.0.0 or higher, step 5 may fail.
# You may fix it by adding webrick to your dependencies: bundle add webrick
bundle add webrick

Configuration

url: https://username.github.io
baseurl:
title:
description:
theme: jekyll-theme-minimal
permalink: none
# date    to /:categories/:year/:month/:day/:title:output_ext (default)
# pretty  to /:categories/:year/:month/:day/:title/
# ordinal to /:categories/:year/:y_day/:title.html
# none    to /:categories/:title.html
# page와 collection은 시간이나 범주가 없기 때문에 permalink는 무시된다.

markdown: GFM # or kramdown, GFM(GitHub Flavored Markdown), https://github.github.com/gfm/
comments: true
plugins:
  - jekyll-asciidoc
  - jekyll-target-blank
  ..._config.yml
# frozen_string_literal: true
source "<https://rubygems.org>"
gemspec
gem "jekyll-theme-chirpy", "~> 7.2", ">= 7.2.4"
gem "html-proofer", "~> 5.0", group: :test
platforms :mingw, :x64_mingw, :mswin, :jruby do
  gem "tzinfo", ">= 1", "< 3"
  gem "tzinfo-data"
end
gem "wdm", "~> 0.2.0", :platforms => [:mingw, :x64_mingw, :mswin]
gem 'jekyll-target-blank'Gemfile

Creating posts

---
layout: post
permalink:
published:
title:
date: YYYY-MM-DD hh:mm:ss +0900
categories: blog
tags: []

custom-variable:
---

이하 본문

{% highlight javascript %}
{% endhighlight %}

[Jekyll docs][links-1]
[Post-1]({% post_url yyyy-mm-dd-post %})

[links-1]: {% link /assets/files/doc.pdf %}_posts/yyyy-mm-dd-post.md

Git sync

# Bundler cache
.bundle
vendor
# if publishing your site with GitHub Pages, you can match production version of Jekyll
# by using the github-pages gem instead of jekyll in your Gemfile.
# In this scenario you may also want to exclude Gemfile.lock from your repository
# because GitHub Pages ignores that file.
Gemfile.lock

# Jekyll cache
.jekyll-cache
.jekyll-metadata
.sass-cache
_site

# RubyGems
*.gem

# NPM dependencies
node_modules
package-lock.json

# IDE configurations
.idea
.vscode

# Misc
_sass/vendors
assets/js/dist.gitignore
git add *
git status
git commit -m 'Initial commit'
git remote add origin https://github.com/owner/repository.git
git remote -v
git push origin main

ref.


Edit page
Share this post on:

Previous Post
Astro를 사용하여 GitHub Pages 사이트 만들기