1 minute read

GitHub Pages

GitHub를 통해 제공되는 static web site 호스팅서비스.

  • 자신의 repository 에서 특정 branch 또는 directory의 markdown files를 기반으로 정적(static) site를 생성.
  • Jekyll 와 markdown을 기반으로 동작함.

만들기.

  1. GitHub 계정이 있어야 함.
  2. New Repository를 생성
    • [username].github.io 라는 이름으로 repository를 생성: [username] 을 자신의 계정명으로 변경.
    • dsaint31x가 계정명이면, dsaint31x.github.io가 됨.
    • README.md를 생성하는 것을 클릭하여 생성.
  3. Repository 이름 밑의 메뉴들 중 오른쪽의 톱니모양 아이콘의 Settings (설정)을 클릭.
  4. Sidebar (왼쪽) 에서 Code and automation 파트에 Pages를 클릭.
  5. Build and deployment 에서 SourceDeploy from a branch 를 선택: 특정 branch에서 웹페이지를 생성하도록.
  6. Build and deployment 에서 BranchNone에서 main으로 변경하고 Save 클릭.

2번에서 애기한 repository 이름을 다른 repository 이름으로 사용하면, [username].github.io/[repository이름] 의 경로가 호스팅 되는 url이 됨.

파일 내용 만들기.

Jekyll 테마를 remote theme로 적용하면 우선 쉽게 시작할 수 있음.

1. _config.yml 을 생성.

repository의 root directory에 생성(=추가).

1
2
3
4
remote_theme: "mmistakes/minimal-mistakes"
title: Octocat's homepage
description: Bookmark this to keep an eye on my project updates!

2. Gemfile 을 생성.

repository의 root directory에 생성(=추가)

1
2
3
4
5
source "https://rubygems.org"

gem "jekyll"
gem "github-pages", group: :jekyll_plugins
gem "jekyll-include-cache", group: :jekyll_plugins

3. index.html 을 생성.

repository의 root directory에 생성(=추가)

1
2
3
4
---
layout: home
author_profile: true
---

4. _posts 디렉토리를 생성.

GitHub에서 _posts/YYYY-mm-dd-[제목].md 를 생성.

  • [제목] 을 적절한 문자열로 교체 (영문추천)

다음과 같이 기재

1
2
3
4
5
6
7
8
9
10
11
---
title: "Hello World"
date: 2024-12-21 21:30:45 +0900
categories: remote theme test
---

## Remote Theme Test

Hello World!  
Hello Jekyll!  
Hello Markdown
  • title : 글의 제목
  • date : 글을 기재한 날짜.
  • categories : 카테고리.

아래 부분은 본문에 해당함.

그 외.

아래 Minimal Mistakes remote theme starter 를 이용하면 보다 간단함.

References

Comments