hexo 블로그를 github에 배포하여 블로그를 공개해보자!!
안녕하세요.
굳헬로 @goodhello 입니다.
어제는 스팀잇 글을 가져와서 만든 hexo 블로그에 테마를 적용해 보았는데요.
이제 테마를 고쳐 본격적으로 멋진 블로그를 만들기에 앞서, 오늘은 이제까지 만든 hexo 블로그를 github에 배포하고 웹사이트에서 확인하는 작업을 해보겠습니다.
먼저 github에 접속해서 hexo 블로그를 배포할 저장소를 만들어야 합니다.
참 이전에 계정을 안 만드신 분은 계정부터 만들어야 겠네요.
계정은 아이디를 설정하고 이메일 주소와 비번을 설정한 후 간편하게 만들 수 있는데요.
제 계정명인 goodhello를 이미 다른분이 먼저 만드셔서... ㅠㅠ
눈물을 머금고 저는 goodhihello로 만들었네요.
계정을 만들고 로그인 한 후 첫 화면 왼쪽 상단의 New 버튼을 눌러서 저장소를 만들어 보겠습니다.
hexo 블로그를 저장할 저장소는 본인계정명.github.io 로 넣으시면 됩니다.
저 같은 경우 goodhihello.github.io 이렇게 만들었답니다.
그러면 이제 위와 같은 화면으로 접속되는데 Quick setup 아래 있는 https://github.com/goodhihello/goodhihello.github.io.git 이 주소를 복사해서 hexo 블로그의 설정파일인 _config.yml 의 deploy에 넣어줘야 합니다.
_config.yml 파일을 열어보면
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: ''
Deployment 부분에 값이 비어져 있는데
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: https://github.com/goodhihello/goodhihello.github.io.git
branch: master
위와 같이 type 는 git으로 넣어주시고,
repo 를 입력하고 github 주소인 https://github.com/goodhihello/goodhihello.github.io.git 을 넣어주고,
branch: master 라고 넣어 줍니다.
이제 배포를 위한 설정이 끝났으니 hexo 블로그를 github에 배포해 보겠습니다.
먼저 다음의 명령어를 입력하여 정적 리소스를 생성해주어야 합니다.
hexo generate
위의 명령어를 실행하면
D:\blog\steemblog>hexo generate
INFO Checking dependencies
INFO Validating the configuration file
INFO Start processing
INFO Files loaded in 8.57 s
INFO Generated: 2020/03/09/hive-101145-goodhello-3fdzzz-hexo/index.html
INFO Generated: 2020/03/10/hive-101145-goodhello-2gx11o-hexo/index.html
.
.
.
INFO Generated: categories/index.html
INFO Generated: page/118/index.html
INFO Generated: tags/index.html
INFO 2452 files generated in 2.25 min
github에 배포하기 위해 hexo 블로그 내에 있는 마크다운 파일들이 정적 파일인 html로 변경되게 됩니다.
그리고 배포를 하기 위해
hexo deploy
위의 명령어를 실행하면
D:\blog\steemblog>hexo deploy
INFO Checking dependencies
INFO Validating the configuration file
ERROR Deployer not found: git
오류가 발생하는데...
배포 플러그인이 아직 설치되어 있지 않아서 발생한 오류입니다.
npm install hexo-deployer-git --save
위의 명령어를 실행하여 배포 플러그인을 설치해 주고 난 후 다시 배포 명령어를 실행하면
D:\blog\steemblog>hexo deploy
INFO Checking dependencies
INFO Validating the configuration file
INFO Deploying: git
INFO Setting up Git deployment...
Initialized empty Git repository in D:/blog/steemblog/.deploy_git/.git/
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
위와 같이 Please tell me who you are 라면서 Run 아래 문구를 입력하여 당신이 누군지 알려달라고 하는군요.
git config --global user.email "[email protected]"
git config --global user.name "goodhello"
하라는대로 내가 누군지 알려주고 한번더 배포 명령어를 실행합니다.
그러면 배포 작업이 진행되게 되고
github 로그인 창이 뜨면 로그인을 해주면 모든 작업이 완료됩니다.
이제 조금전에 만든 goodhihello.github.io 저장소에 hexo 블로그 내용이 모두 올라간 걸 확인할 수 있습니다.
이제 저장소명으로 웹사이트에 접속해 보겠습니다.
https://goodhihello.github.io/
이제까지 만든 hexo 블로그가 성공적으로 배포되어 웹사이트에서 확인이 잘 되고 있네요.
그럼 오늘은 여기까지!!!
이제 스팀잇 글을 hexo 블로그로 가져와서 github에 배포하여 블로그 만드는 작업까지 완료 되었네요.
이제 블로그를 꾸며나갈 일이 남았는데요. 아마도 이게 제일 많은 노력과 시간과 열정이 필요할 것 같은데.... 그래도 매일 매일 조금씩이라도 열심히 만들어 보도록 하겠습니다.
그럼 여러분들도 파이팅 하시고~ 오늘 하루도 행복 하세요~
@tipu curate
Upvoted 👌 (Mana: 30/35 - need recharge?)
독거형님 ㅋㅋㅋㅋㅋ
비키니 사진 올리다 실패하신거죠???
흠... 왜 안올라왔지!! 이상하네요~ 다시~
외국어보다 어려운...^^;;
Posted using Partiko Android
앗!!! 어려웠나요???
그냥 따라만 하면 되도록 쓰려고 했는데... 쉽지가 않군요...
선생님 문제가 아니라 학생의 의지가 박약한 듯 합니다.ㅎㅎ
Posted using Partiko Android
Hi @goodhello!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 3.540 which ranks you at #4347 across all Steem accounts.
Your rank has dropped 13 places in the last three days (old rank 4334).
In our last Algorithmic Curation Round, consisting of 75 contributions, your post is ranked at #19.
Evaluation of your UA score:
Feel free to join our @steem-ua Discord server