hexo github搭建部落格系統

2021-09-16 22:35:16 字數 1177 閱讀 9186

準備工作

建立github倉庫

倉庫的名稱是username.github.io其中username是你的使用者名稱

例如我建立的倉庫名稱為test,我就可以用

配置sshkey

ssh-keygen -t rsa -c "郵件位址"
在使用者目錄下找到.ssh/id_rsa.pub檔案,將內容複製到github中

配置全域性使用者

$ git config --global user.name "***x"// 你的github使用者名稱,非暱稱

$ git config --global user.email "***[email protected]"// 填寫你的github註冊郵箱

搭建hexo
...

# url

## if your site is put in a subdirectory, set url as '' and root as '/child/'

url:

root: /home/blog/

permalink: :year/:month/:day/:title/

permalink_defaults:

...

上傳的github
# deployment

## docs:

deploy:

type: git

repo: [email protected]:***x/test.github.io.git

branch: master

注意:冒號後面要有空格,不然會出錯

常用命令

hexo new "postname" #新建文章

hexo new page "pagename" #新建頁面

hexo generate #生成靜態頁面至public目錄

hexo server #開啟預覽訪問埠(預設埠4000,'ctrl + c'關閉server)

hexo deploy #部署到github

hexo help # 檢視幫助

hexo version #檢視hexo的版本

hexo github部落格搭建

前期步驟詳見 網域名稱解析配置時,主機記錄www項中,點選記錄型別選擇cname。網域名稱https需要申請ssl證書 這裡僅申請即可 申請後即自動轉為https,無需以上文章中的其餘操作。執行hexo clean hexo g hexo d時,以下均需要進到.deploy git目錄中git ba...

hexo github 搭建部落格實戰

之前有兩篇部落格莫名被csdn給刪除了,一時興起,想想要不搭建乙個個人部落格。於是選擇了比較常見的github hexo。自己的電腦是mac air,由於以前驅動一些硬體的需要,安裝了windows,後來一直沒有換回來。搞github hexo,前途凶險。看小夥伴的搭建過程,感覺還是在mac 系統下...

hexo github搭建個人部落格

安裝 git,hexo,nodejs 由於這不是一篇詳細的如何搭建過程所以詳細的請看其他的 如 這位老鐵的 1.新建文章 在根目錄下右擊 git bash here 輸入 hexo new three 則會在hexo source posts目錄下找到three.md 開啟編輯即可 vs code編...