1.安裝程序:
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.name和user.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上的博客
-
4.總結:
我的Blog [Later Fork's Studio]
使用的是WIN10操作,適用于廣大小白。
我只用少量的圖片與文字來寫這篇部署的操作指南。
在文章的多處有超鏈接的地方是操作的捷徑,希望大家狠戳。
綜上所述,目的是為了在極短時間內搭建好博客大概的模樣。
-
Hexo+Gihub搭建的更深一步參考: