架設HEXO網頁
架設網站前的準備工作
- 載入最新的node.js 和 npm
- 檢查 node.js 是否成功下載,那就是查詢下載的版本
- 輸入
$ node -v只要版本數字是跟你下載官網上顯示的版本相同即是下載完成 - 輸入
$ npm -v看到版本數字及是下載完成
HEXO 網站架設第一步
- 打開終端機輸入指令
$ npm install hexo-cli -g- 輸入
hexo init blog載入部落格套件 - 終端機輸入指令進入
cd blog - 可以開啟伺服器
hexo server看看你的網頁是否架設成功
新增部落格新的文章
輸入
hexo new + 新貼文標題撰寫內容
連接 Github new repository
更改
_config.yml下方URL的現有資料,並新增以下組態:## Set your site url here. For example, if you use GitHub Page, set url as 'https://username github.io/project' url: https://(username).github.io/(project)在 GitHub Pages 上部署 Hexo
部屬連結安裝 hexo-deployer-git.
清空
_config.yml下方deploy的現有資料,並新增以下組態:type: git repo: https://github.com/<username>/<project> # example, https://github.com/hexojs/hexojs.github.io branch: gh-pages將你的 github 名稱和 repository 檔名輸入上去
hexo cleanhexo deploy