一个慢慢前行的小白

Github+Hexo 博客配置

    Hello World     github·hexo

Github 配置

  • 新建一个版本库
  • 启用GitHub Page

Hexo 配置

  • 安装 hexo 及相关配置
1
2
3
4
$ npm install hexo-cli -g
$ hexo -v "检验安装是否正确"
$ hexo init "初始化"
$ hexo g (hexo generate) "生成静态文件,储存在public文件夹中"

预览

1
$ hexo s (hexo server) "启动本地web服务,用于博客的预览"

预览网址:http://localhost:4000

上传github

  • 需在文件 _config.yml 中设置github地址
1
2
3
4
deploy:
 type: git
 repo: git@github.com:SandBoat/SandBoat.github.io.git
 branch: master
  • 运行命令
1
$ hexo d (hexo deploy) "上传服务器"
页阅读量:  ・  站访问量:  ・  站访客数: