美文网首页Nice程序员工具癖
非程序员15分钟三步Github+Hexo快速搭建免费个人博客

非程序员15分钟三步Github+Hexo快速搭建免费个人博客

作者: 没有车胎的战车 | 来源:发表于2017-10-06 11:00 被阅读265次

1.安装程序:

  • Node.js

  • Git

  • Hexo:

    cmd运行如下代码安装Hexo

    >npm install -g hexo-cli
    

2.搭建博客:

  • 指定路径

    >cd D:\Project\Blog
    
  • 新建博客文件

    >hexo init <输入文件名>
    
    >cd <刚输入的文件名>
    
    >npm install
    
  • 查看建立好的博客

    >hexo server
    

    浏览器输入:http://localhost:4000


3.布置博客:

  • 注册 Github 账号

    • New repository 创建新仓库

    • Repository name 固定写法:Owner.github.io

      (仓库名字 固定写法:用户名.github.io)

    • Description (optional) 填写随意

    • Create repository

  • 打开安装好的 Git Bash

    • 设置 user.nameuser.email的配置信息:

      >git config --global user.name 'Your Github UserName'
      
      >git config --global user.email 'Your Github UserEmail'
      
    • 生成ssh密钥文件

      >ssh-keygen -t rsa -C 'Your Github UserEmail'
      
      直接三个回车,默认不设置密码
      
    • 找到生成的 .ssh 文件中 id_rsa.pub 密钥

      复制 id_rsa.pub 中的内容到 Github Setting Key

      点击右上角 New SSH key

      Title 填写随意,粘贴刚复制的到 Key 中,Add SSH Key

  • 部署博客

    • cmd转到博客文件的目录下

      >cd D:\Project\Blog\MyFirstBlog
      
    • 三条部署命令

      >hexo clean
      
      >hexo g
      
      >hexo d
      
    • 打开浏览器查看部署到Github上的博客

      http://Owner.github.io


4.总结:

相关文章

网友评论

    本文标题:非程序员15分钟三步Github+Hexo快速搭建免费个人博客

    本文链接:https://www.haomeiwen.com/subject/cfplyxtx.html