Blog

利用github托管和hexo打造一个自己的博客

  1. 因为这个博客依托于github托管,首先得要有一个github帐号
  2. 找到Repository name设置为本人github的昵称->create repository
  3. 安装git
  4. 生成ssh密钥文件: ssh-keygen -t rsa -C “你的GitHub注册邮箱”
  5. git bash 输入cd ~ cat id_rsa.pub,打开github.com->settings->keys页面,新建ssh key tittle为标题,随便填,将id_rsa.pub内容粘贴->add ssh key
  6. 在Git Bash中检测GitHub公钥设置是否成功,输入 ssh git@github.com: 收到欢迎信息即可
  7. 安装node.js 安装url 在cmd输入 node -v查看是否安装上了->输入npm -v收到版本信息 安装成功
  8. 安装hexo 新建一个文件夹,用以存放博客的文件,进入文件夹 打开cmd-> npm install -g hexo-cli,安装完成后 hexo init blog
  9. hexo new test_my_site -> hexo g -> hexo s 打开浏览器 127.0.0.1:4000查看是否配置成功
  10. 选择好看的主题根目录下修改_config.yml
  11. 下一步将我们的Hexo与GitHub关联起来,打开站点的配置文件_config.yml,翻到最后修改为:deploy: type: git repo: 这里填入你之前在GitHub上创建仓库的完整路径,记得加上 .git branch: master
  12. hexo clean->hexo g->hexo d->d是deploy的缩写。完成后,打开浏览器,在地址栏输入你的放置个人网站的仓库路径,即 http://xxxx.github.io 然后就能查看自己的博客了
文章目录
  1. 1. 利用github托管和hexo打造一个自己的博客
,