閑來無事,就想著折騰一下??了很久的靜態(tài)博客赠群,一來體驗离咐,二來作為自己記錄工作,日常生活雜事的一個空間帮匾。Let's beginning!?
- 用到了啥
- 博客的初始構(gòu)建
- Node和Git的安裝這里不作贅述啄骇。
- Hexo的安裝參見Hexo官方文檔。
npm install hexo-cli -g
# yourblog.github.io 是下步GitHub倉庫名稱瘟斜,
# yourbolg保持和你的GitHub用戶名保持一致,參見[https://pages.github.com/]
hexo init yourblog.github.io
cd blog
npm install
hexo server
- GitHub倉庫的初始化
參見GitHub Pages
- 設(shè)置及部署
-
GitHub 倉庫設(shè)置
找到倉庫Settings --> GitHub Pages ,選擇master缸夹,Save.
-
此時,便完成了GitHub Pages的基本設(shè)置螺句,會看到
Your site is published at xxx.github.io的提示虽惭。此時你打開這個網(wǎng)址如果你有寫index.html 或者README.md的話,會展示出來壹蔓。
- Hexo 發(fā)布設(shè)置
找到項目路徑下_config.yml文件趟妥,編輯deploy節(jié)點,注意屬性節(jié)點: 后要有一個空格
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:winyiwin/winyiwin.github.io.git
branch: master
最后執(zhí)行 hexo deploy 部署,就完成了簡單的一個基本靜態(tài)blog佣蓉。