Hexo部署到github.io搭建NexT主题博客

install git

install Node.js

1
curl https://raw.github.com/creationix/nvm/v0.33.11/install.sh | sh

Close and reopen your terminal to start using nvm or run the following to use it now:

1
2
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

1
nvm install stable

install Hexo and init

1
2
3
4
npm install -g hexo-cli
mkdir <folder>
hexo init <folder>
cd <folder>

install NexT

Download latest release version:

1
2
mkdir themes/next
curl -s https://api.github.com/repos/iissnan/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1

Set theme in main hexo root config _config.yml file:

1
theme: next

github pages

install plugins:

1
npm install hexo-deployer-git --save

edit /_config.yml

1
2
3
4
deploy:
type: git
repo: https://[github用户名]:[github密码]@github.com/xxx/xxx.github.io.git
branch: master

push to github:

1
hexo g && hexo deploy