blog

hexo로 github 블로그 만들기

오택 2022. 12. 21. 11:01

# 프로젝트 생성

1. git & nodejs 다운로드 및 설치

- git 다운로드: https://git-scm.com/downloads 

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

 

- nodejs 다운로드: https://nodejs.org/ko 

 

Node.js

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

 

2. client & project 생성

- 바탕화면 우클릭 > Git Bash Here

 

- command창에 입력

   $ npm install hexo-cli -g     // hexo client 설치

   $ hexo init <폴더명>         // hexo project 생성

   $ cd <폴더명>

   $ npm install

 

3. 서버 작동 확인

- command 입력

   $ cd <폴더명>

   $ hexo server

 

- https://localhost:4000 이 잘 작동하는지 확인

위와 같이 작동하면 성공

 

# Github 배포

1. github에서 new repository를 생성

- Repository name은 github_id.github.io로 설정

 

2. <프로젝트폴더>의 _config.yml 파일을 수정

# site 에서 블로그 정보를 입력하고

 

# Deployment 를 이렇게 수정한다

<github id> 부분엔 자신의 github id를 쓰면 된다

 

3. github 배포

- 프로젝트 폴더 우클릭 > Git Bash Here

- command 입력

   $ npm install hexo-deployer-git --save    

   $ hexo generate

   $ hexo deploy

 

4. blog 확인

- <github id>.github.io 주소로 접속하여 확인하자 (시간이 조금 소요될 수 있음)