前言
如何將在 GitHub Pages上傳的自定義的靜態(tài)個人頁作為主頁,hexo博客作為其子頁?
新建GithubPage
地址為:yourname.github.io
(這一步可以參考網(wǎng)上的鏈接
新建子頁面的repository
這一步是為了之后將hexo部署到這個repo
名字自定,假設(shè)其為blog
(注:這里的repo的目錄下不需要CNAME文件)
部署Hexo前的準備
修改hexo根目錄的配置文件_config.yml
將url和root修改為如下,確保主頁和子頁形成鏈接,如下:
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://yourname.github.io/blog #改
root: /blog/ #改
permalink: :year/:month/:day/:title/
找到_config.yml下的deploy,把repository修改為blog的地址,如下:
deploy:
type: git
repository: https://github.com/yourname/blog.git #改
branch: master
重新部署博客
hexo clean && hexo g && hexo d
修改repo的setting
?。?!重要:
進入剛建立的blog的settings

image-20200318005215574.png
向下找到Github Pages

image-20200318005607446.png
選擇"master branch"

image-20200318005920707.png
出現(xiàn)綠色框就說明鏈接成功了!
以上。
快去建立自己的博客吧~