Hexo 시작하기

준비하기

구름IDE 컨테이너 만들기

  • 로그인
  • 대시보드 -> 새 컨테이너 생성
  • 소프트웨어 스택 ‘Node.js’ 선택

hexo 설치

1
2
3
4
5
6
$ npm install -g npm // npm 버전 업그레이드
$ npm install hexo-cli -g
$ hexo init hexoblog

$ cd hexoblog
$ npm install

hexo 테마 다운로드

1
2
$ cd themes
$ git clone [원하는 테마의 github 링크]

hexo 테마 적용

  • _config.yml
1
2
3
4
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: [clone한 폴더명]

글 작성하기

1
$ hexo new post 'title'

구름IDE에서 호스팅하기

1
$ hexo server -p 3000

Github repository 생성

‘[github_id].github.io’ 로 새로운 repository를 생성합니다

Github 연동

  • _config.yml
    1
    2
    3
    4
    5
    6
    # Deployment
    ## Docs: https://hexo.io/docs/deployment.html
    deploy:
    type: git
    repo: [생성한 git repository 주소 (.io까지)]
    branch: master

Github 배포

1
2
3
4
5
6
7
8
$ git config --global user.name [내 이름]
$ git config --global user.email [github 계정]

$ hexo clean # 수정내역이 적용 안되는 경우 한번씩 청소해주는 역할
$ hexo generate
$ hexo deploy

$ hexo deploy --generate # generate와 deploy 한번에 실행

참고 : 유튜브

Comments