What GitHub Pages is
GitHub Pages
GitHub를 통해 제공되는 static web site 호스팅서비스.
- 자신의 repository 에서 특정 branch 또는 directory의 markdown files를 기반으로 정적(static) site를 생성.
- Jekyll 와 markdown을 기반으로 동작함.
만들기.
- GitHub 계정이 있어야 함.
- New Repository를 생성
[username].github.io
라는 이름으로 repository를 생성:[username]
을 자신의 계정명으로 변경.dsaint31x
가 계정명이면,dsaint31x.github.io
가 됨.README.md
를 생성하는 것을 클릭하여 생성.
- Repository 이름 밑의 메뉴들 중 오른쪽의 톱니모양 아이콘의
Settings
(설정)을 클릭. - Sidebar (왼쪽) 에서
Code and automation
파트에Pages
를 클릭. Build and deployment
에서Source
를Deploy from a branch
를 선택: 특정 branch에서 웹페이지를 생성하도록.Build and deployment
에서Branch
를None
에서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 를 이용하면 보다 간단함.
Comments