HEXO 발행

전수·2022년 9월 16일

GIT

목록 보기
5/5

개발 블로그

내가 지금 작성하고 있는 velog 외에도 다양한 개발 블로그 플랫폼이 존재한다.
그리고 다양한 언어 기반의 정적 블로그 생성기(Static Site Generator)들도 존재한다.

- Jekyll : Ruby 기반의 정적 블로그 생성기로 설치와 사용이 쉬움.

- Hugo : Golang 기반의 정적 블로그 생성기로 빠른 속도로 사이트를 생성할 수 있음

- Hexo : Node.js 기반의 정적 블로그 생성기로 Node.js를 안다면 커스터마이즈가 쉬움.

나는 이 중에서 hexo 블로그를 생성해보려고 한다.


hexo

hexo 환경 구성

위에 기술되었듯이 hexo는 node.js 기반의 정적 블로그 생성기이기 때문에 node.js와 git이 설치되어 있어야 한다.


hexo 설치

$ npm install -g hexo-cli

hexo 폴더 생성

$ hexo init (folder_name)

$ cd (folder_name)

$ npm install

$ hexo new [layout] "title" ## layout은 post 활용

$ vi source/_posts_/title.md
## 상세 내용(title, tags, contents) 작성

hexo 생성하고 확인하기

$ hexo generate

$ hexo server		##local에서 확인

github주소 발행하기

- new repository 생성

- repository의 이름은 username.github.io

- 생성 후 발행된 주소 활용

hexo-deployer-git 설치

$ npm install hexo-deploy-git --save

## Edit _config.yml
$ vi _config.yml
## title, author, url(https://username.github.io) 변경
## type: git, repo: 발행주소, branch: main

post 발행

$ hexo clean && hexo generate

$ hexo server

$ hexo deploy
## post 발행 완료

hexo 테마 변경하기

## next 테마로 변경
$ npm install hexo-theme-next --save

$ vi _config.yml
## theme: next

$ hexo clean && hexo generate

$ hexo server 

$ hexo deploy
## 테마 변경 완료

0개의 댓글