title: 使用hexo搭建博客(三)
date: 2020-02-03 13:40:59
tags: hexo,blog
categories: 教程
部署發行項目
前言
這篇文章是基於你已經註冊了github賬號和創建了對應的倉庫,通過配置ssh來建立連接
創建Repository
創建一個Repository,名稱規則爲
username.github.name
然後編輯hexo的配置文件_config.yml,修改如圖示地方。repo修改你的倉庫地方
生成ssh
$ ssh-keygen -t rsa -C "郵件地址@youremail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<回車>
然後一路回車
.賦值id_rsa.pub文件內容,在github的settings中,點選SSH keys,添加一個key,將內容粘貼進去
[外鏈圖片轉存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-wG5DMhTD-1580865706250)(C:\Users\lyh\AppData\Roaming\Typora\typora-user-images\1580714396039.png)]
測試是否添加成功
ssh -T [email protected]
部署到github上
在hexo中分別進行生成,上傳
hexo g
hexo d
部署成功後,可通過 http://pangyuanni.github.io 進行訪問,其中將pangyuanni替換爲你自己的username即可
此次分享到這兒 下篇博客分享如何部署到自己的與服務器上