2019你还没搭建个人博客吗?进来看看

2,997 阅读1分钟

使用hexo+github搭建个人博客

一、准备工作

二、 hexo要上场表演啦

  1. 构建项目

    $ hexo init <项目名称>
    $ cd <项目名称>$ npm install

  2. 启动项目

    $ hexo s
  3. 修改配置_config.yml

    //修改标题# Site
    title: 王新月的博客
    subtitle: 前端历程
    //修改上传地址# Deployment
    ## Docs: https://hexo.io/docs/deployment.html
    
    
    deploy:
      type: git
      repo: https://github.com/cc/cc.github.io.git
      branch: master
    
  4. 修改source/_posts/hello-world.md,你就得到了下面的页面



三、 hexo已经到达战场

  1. 装个热更新

    $ npm install hexo-browsersync --save

  2. 装个git 支持就能上传了

    $ npm install hexo-deployer-git --save

  3. hexo应到达战场

    $ hexo g //打包
    
    $ hexo d //上传到github 

  4. 输入网址查看

       https://cc.github.io.git  (cc是你到github用户名)

四、搞个皮肤sou

这里推荐yilia主题

  1. 下载命令

    $ cd ./themes/
    $ git clone https://github.com/JoeyBling/hexo-theme-yilia-plus.git ./yilia-plus

  2. 修改配置文件

    # Extensions
    ## Plugins: https://hexo.io/plugins/
    ## Themes: https://hexo.io/themes/
    theme: yilia-plus
  3. 重新构建并重启

    $ hexo g //打包
    
    $ hexo s//重启
    
    $ hexo clean //如果未生效后在重新hexo g
    $ hexo d //上传到github 
    
    


如果你想要其他主题可以在官方下载:hexo.io/themes/

王新月的博客

叽里咕噜改配置