使用Hexo打造自己的个人博客
Now we can use hexo,github and your domain to make a site like here.
You must prepare something:
- hexo
- github account
- your domain
Use Hexo
Install node
hexo used node so we must install node before all,I use homebrew in Mac:brew install node
Create blog folder and install hexo :
mkdir blog
cd blog
npm install hexo-cli -gTest hexo :
hexo server
then you can visit http://localhost:4000 to see your hexo blog
all config info in _config.yml
Use github domain mapping your blog
now we will use usename.github.io domain mapping your blog
- create your io repository
create it and the repository name must be user_name.github.io,user_name is your github user name
like me https://github.com/BestBurning so my user name is BestBurning and my io domain repo is BestBurning.github.io - mapping your local blog
change _config.ymlvi _config.yml
at the bottom,you can find deploy,make it like
deploy: |
save and exec command
npm install hexo-deployer-git --save |
then you can visit your io domain like bestburning.github.io
Mapping your own domain to github.io domain
diyishuai.cn is my domain , and if you visit it will redirect to bestburning.github.io
- Use your domain analyze to your user_name.github.io
- add CNAME with www to point user_name.github.io
- add A with @ to point io domian ip
- at blog/soruce folder ,touch file named CNAME
vi blog/CNAME
add your domain to it
diyishuai.cn |
deploy it
hexo deploy |
- then you can visit diyishuai.cn to visit your blog
hexo have some themes you can select it ,good luck!
本文标题:使用Hexo打造自己的个人博客
文章作者:Shea
原始链接:https://di1shuai.com/hexo.html
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!