本篇主要記錄一些本身github博客搭建的過程。node
注:本篇主要寫搭建博客,工具類的再也不贅述git
咱們假設你已經有了一個 github 帳號,你須要添加一個新的 new repository。點擊建立一個新的 repository ,你須要將你的 Repository name 設置爲 ** 帳戶名.github.io **
,這一步相當重要。github
在建好的項目右側有個settings按鈕,點擊它,向下拉到GitHub Pages,你會看到一個 http://帳戶名.github.io 的網址,這樣,你已經有一個屬於本身的博客啦。npm
npm install hexo -g
,開始安裝Hexohexo -v
,檢查hexo是否安裝成功hexo init
,初始化該文件夾。看到 ** 「Start blogging with Hexo!」 **
即成功npm install
,安裝所需組件hexo g
,對文件進行編譯輸入 hexo s
,輸入hexo s
,開啓服務器,訪問該網址,正式體驗Hexo。
個人默認端口是4000,若是你的頁面一直沒法跳轉,多是端口號被佔用,能夠經過 hexo server -p 端口號
進行修改。服務器
git config --global user.name "xxx" git config --global user.email "xxx@gmail.com"
id_rsa,id_rsa_pub,known_hosts
,則說明存在。ssh-keygen -t rsa -C "你的github郵箱地址"
,連續三個回車,生成密鑰,也會自動生成兩個文件:id_rsa和id_rsa.pub
(默認存儲路徑是:C:\Users\Administrator\.ssh
)eval "$(ssh-agent -s)"
,添加密鑰到 ssh-agentssh-add ~/.ssh/id_rsa
,添加生成的 SSH key 到 ssh-agentdeploy: type: git repo: git@github.com:limoon7/limoon7.github.io.git branch: master
npm install hexo-deployer-git --save
hexo d -g
,生成以及部署了hexo -s
命令hexo clean
,hexo -g
,hexo -s
, hexo -d
是否是以爲配置好的不是很美觀,那就來一個優雅大方的主題吧!hexo
-hexo d 出現ssh鏈接問題,以下所示編輯器
ssh: connect to host github.com port 22: Connection timed out
解決方法:git 鏈接 github 超時問題工具
歡迎你們訪問個人博客:lemon的世界post